Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on July 26, 2014, 09:14:08 PM

Title: Post and PM Inline Attachments
Post by: dougiefresh on July 26, 2014, 09:14:08 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=3770)





Post and PM Inline Attachments
For SMF 2.0 and SMF 2.1
v7.11


By Dougiefresh (https://www.simplemachines.org/community/index.php?action=profile;u=253913) and GL700Wing (https://www.simplemachines.org/community/index.php?action=profile;u=112942)
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=3770)



Introduction
This mod adds the ability to position your attachments inline in either a forum post or personal message using the [attach id=n msg=NNNN] BBCode where n is the number of the attachment in the post/message (eg: first = 0; second = 1; etc) and, for forum posts, NNNN is the forum message number.





NOTES FOR SMF 2.0

In order to fully support the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod you must install this mod first!!
Also, if you subsequently need to uninstall this mod you must uninstall the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod beforehand.

In order to support inline attachments in personal messages (PMs) you must install the PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974) mod **version 2.6 or later** before you install this mod!!
Also, if you subsequently need to uninstall the PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974) mod you must uninstall this mod beforehand.

The SMF default WYSIWYG editor will be disabled when this mod is installed because if it is enabled the '(Insert Attachment)' link will not work.

** IMPORTANT NOTE FOR FORUMS USING TAPATALK **
If the Tapatalk plug-in is subsequently updated/reinstalled this mod must be uninstalled and reinstalled as it updates some of the Tapatalk plug-in files.  Failure to do this may result in Tapatalk timing out when displaying boards, unread posts, etc.




NOTES FOR SMF 2.1

Support has been added for SMF 2.1 to provide backward display and print page compatibility for ILA BBCodes in existing posts of forums that used this mod prior to being upgraded from SMF 2.0.  In addition, Print Page image layout/formatting is the same as when this mod was installed on SMF 2.0.

Support will not be added to this mod for inserting attachments inline.

Unfortunately, and because a message may contain a mix of ILA BBCodes and native SMF 2.1 BBCodes for attachments that are inserted inline, it is not possible to remove an obsolete ILA BBCode (eg, [attach id=4 msg=5678]) from the body of a message when an attachment is deleted.
Therefore, if an attachment that was inserted inline into a message by this mod is subsequently deleted the message must be saved and then edited again to remove the ILA BBCode that refers to the deleted attachment (eg, [attach id=4 msg=5678]) before more attachment are added to the message.
If this procedure isn't followed the text "[ Invalid Attachment ]" may appear when the message is displayed/printed and/or if another attachment is added it will be displayed/printed in the message using the ILA BBCode (eg, [attach id=4 msg=5678]) that refers to the deleted attachment.





New BBCodes
This mod supports five new BBCodes in order to position your attachments inline:
o attachment => Show full expanded picture
o attach => Show thumbnail, expandable to full picture
o attachthumb => Show thumbnail ONLY, not expandable
o attachmini => Show thumbnail, expandable to full picture
o attachurl => Shows attachment size, image dimensions, and download count; no picture

Version 1.x BBCodes Parameters
Each new BBCode accepts the following formats:
[attach={id}][/attach]
[attach={id},{width}][/attach]
[attach={id},{width},{height}][/attach]

In each case, {id} is the attachment number relative to the topic, {width} is the max desired width, {height} is the max desired height, {pixels} is the number of pixels surrounding the image, and {float} can be either left, right, or center.  All text between the opening and closing attachment tags is discarded.

Version 2.0+ BBCode Parameters
Version 2.0+ introduced a new format that allows the following parameters:
[attachment id={id} {parameter}={value}][/attachment]

Allowed parameters:
id{attachment id}    ID number of the attachment to show inline (NOT attachment number!)
width{width}Desired width of image to show.  Valid: positive integers.
height{height}Desired height of image to show.  Valid: positive integers.
float{float}Floats image to relation to everything else.  Valid: left, right, center
margin{pixels}Margin around inline attachment.  Valid: positive integers
margin-left{pixels}Left margin around inline attachment.  Valid: positive integers
margin-right{pixels}Right margin around inline attachment.  Valid: positive integers
margin-top{pixels}Top margin around inline attachment.  Valid: positive integers
margin-bottom    {pixels}Bottom margin around inline attachment.  Valid: positive integers
border-style{style}Border style.  Valid: none, dotted, dashed, solid, double, groove, ridge, inset, outset
border-width{pixels}Border width around inline attachment.  Valid: positive integers
border-color{color}Border color.  Valid formats: plain text, #xxx, #xxxxxx, rbg(d,d,d)
scale{answer}Override scaling of image.  Valid: true, false, yes, no
msg{msg ID}Message ID number.  Valid: positive integers.
In each case, {id} is the attachment number relative to the topic, {width} is the max desired width, {height} is the max desired height, {pixels} is the number of pixels surrounding the image, and {float} can be either left, right, or center.  All text between the opening and closing attachment tags is discarded.

Version 3.0+ BBCode Format
Version 3.0 makes further changes and allows the use of the inline attachments BBCodes without closing brackets, as well as using attachments from another post!

Version 3.11+ BBCode Format
Version 3.11 makes further changes and allows the use of closed tags, like [attach].  This new form is auto-numbered!
Note that the [attach] tag is processed first, then [attachment], then [attachmini], then [attachthumb], then [attachurl].

Other Mod Features
o Error Text strings are shown for invalid/missing/deleted attachments.
o Inline attachment processes takes place in the parse_bbc function, which means any parsing requests can benefit from this mod!
o Text string is shown as alternative in code.
o Adds [Insert Attachment x] next to each attachment/upload box to insert the BBCode.
o Attachments used by the inline attachments mod can be omitted from the attachment display at the bottom of the post.
o Reloads the attachments for Ajax Editing.
o Removing an attachment removes the attachment BBCode for that attachment & changes remaining attachment tags to ensure proper post appearance.
o Text between inline attachment brackets are removed (as of version 3.0).
o Automatic modification of boilerplates that use the ILA tags within them when changing "1-based" numbering option.
o For print page view - option to show inline images in the message body, and to show non-inline images and list non-image attachments below the message body.

Admin Settings
The BBCode may be disabled by going to Admin -> Forums -> Posts and Topics -> Bulletin Board Code and unchecking the attachment BBCode.

On the Admin -> Layout -> Attachments and Avatars -> Inline Attachments page, there are several new options:
o Remove attachment image under post after in-post use.
o Use "One based numbering" for attachment IDs (first attachment is 1 instead of 0).
o Allow quoted attachment images from another post.
o Show download link and counter under inline attachment, like non-inline attachments.
o Turn off "nosniff" option for IE and Chrome browsers.
o Whether "attach" tag is the same as the "attachment" tag.
o Allow playing inline attachments that are videos.
o Use Highslide effects for inline attachments. (Only if supported Highslide mod is installed)
o Show EXIF information. (Only if EXIF (https://custom.simplemachines.org/mods/index.php?mod=169) mod is installed)
o Display attachments below the post in a line/row (the number of attachments per row/line can be configured). (v7.00 onwards)
o Separate download link and counter for attachments displayed below post. (v7.00 onwards)

Attachment Download Permissions (v7.00 onwards for SMF 2.0 only)
o Added 'Do NOT allow attachments displayed inline to be downloaded' and 'Do NOT allow attachments displayed below post to be downloaded' permissions to prevent attachments displayed inline and/or below the post from being downloaded (only thumbnails and/or attachment names will be shown).  Configured via Admin -> Permissions -> General Permissions.  Can be configured for membergroup and/or board permission profiles.

Compatibility Notes
This mod was tested on SMF 2.0.17, but should work on SMF 2.0 and up.
SMF 1.x is NOT supported.
SMF 2.1 will NOT be supported for inserting attachments inline as this is a standard feature of SMF 2.1.

The following mod (not required) must be installed after this mod:
o Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087)

These mods (not required) must be installed before this mod:
o Tapatalk plug-in** (https://www.tapatalk.com/download_SimpleMachines)
o Who Downloaded Attachment (https://custom.simplemachines.org/mods/index.php?mod=4146)
o Anti-Spam Links (https://custom.simplemachines.org/mods/index.php?mod=2404)
o Highslide Image Viewer (https://custom.simplemachines.org/mods/index.php?mod=1450)
o HS4SMF v0.8.1 (https://github.com/Spuds/SMF-HS4SMF)
o PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974)

These mods (not required) can be installed at any time:
o JQLightBox (https://custom.simplemachines.org/mods/index.php?mod=1605)
o SCEditor4Smf (https://custom.simplemachines.org/mods/index.php?mod=3594)
o EXIF (https://custom.simplemachines.org/mods/index.php?mod=169)
o Boilerplates for Posts (https://custom.simplemachines.org/mods/index.php?mod=2233)
o Lazyload (https://custom.simplemachines.org/mods/index.php?mod=4259)
o SMFPacks Advanced Editor (https://www.smfpacks.com/wysiwyg/)
o Play Media Attachments (https://custom.simplemachines.org/mods/index.php?mod=4131)

The following mods (not required) may also be installed before versions of this mod prior to v7.00 - they are not compatible with v7.00 and must be uninstalled prior to installing v7.00 or later.
o Custom View of Attachments (https://dragomano.ru/mods/custom-view-of-attachments)
o New Hooks (https://www.simplemachines.org/community/index.php?topic=418177.msg3499865#msg3499865) (Required for Custom View of Attachments (https://dragomano.ru/mods/custom-view-of-attachments))

The following mod (not required) may also be installed before versions of this mod prior to v7.03 - it is not compatible with v7.03 and must be uninstalled prior to installing v7.03 or later.
o Images on Print Page (https://github.com/Spuds/SMF-Images-on-Printpage)

Translators
o Dutch: @rjen (https://www.simplemachines.org/community/index.php?action=profile;u=287786)
o Spanish Latin: RockLee (https://www.simplemachines.org/community/index.php?action=profile;u=322597)

License
QuoteCopyright (c) 2014-2020 Douglas Orend, 2018-2023 Kathy Leslie
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer; and
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 28, 2014, 06:44:18 PM
Uploaded v1.1 - July 28th, 2014
o Fixed two undeclared array element errors in PersonalMessage.template.php...

EDIT: Fixed inccorect year in release info....
Title: Re: Post and PM Inline Attachments
Post by: grimmoire on July 30, 2014, 01:39:36 PM
Hello!

Thank you for this mod.

But i have one problem after installation. When i create new topic, i can insert inline attachment only for first attachment, for others link is not displayed:

(http://www.pixic.ru/i/W0z00487P91196s0.jpg)

If i create topic or message and edit it later, everything all right.

Highslide4SMF is installed.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 01, 2014, 07:53:18 PM
Quote from: grimmoire on July 30, 2014, 01:39:36 PM
Hello!

Thank you for this mod.

But i have one problem after installation. When i create new topic, i can insert inline attachment only for first attachment, for others link is not displayed:

(http://www.pixic.ru/i/W0z00487P91196s0.jpg)

If i create topic or message and edit it later, everything all right.

Highslide4SMF is installed.
I'm gonna have to figure out why this is happening....
Title: Re: Post and PM Inline Attachments
Post by: nuberry on August 04, 2014, 07:50:03 AM
Hi there
looks like a great mod, however when i load it says  - Test failed (Ignore Errors)

is this okay , should i ignore or is there a conflict

many thanks
andrew
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 04, 2014, 07:47:13 PM
Not having the PM attachments mod installed will result in the "Test Failed (Ignore Errors)" message.  The Post Inline Attachments will work, but PM Inline Attachments won't work without PM Attachments mod installed.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 11, 2014, 04:05:41 PM
Quote from: dougiefresh on August 01, 2014, 07:53:18 PM
Quote from: grimmoire on July 30, 2014, 01:39:36 PM
Hello!

Thank you for this mod.

But i have one problem after installation. When i create new topic, i can insert inline attachment only for first attachment, for others link is not displayed:

(http://www.pixic.ru/i/W0z00487P91196s0.jpg)

If i create topic or message and edit it later, everything all right.

Highslide4SMF is installed.
I'm gonna have to figure out why this is happening....
I apologize about the late response....

UPDATE: I've got the Post inline attachments working correctly, however, the PM inline attachments is giving me trouble.  Will keep at it until I get it fixed....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 11, 2014, 05:35:50 PM
Uploaded v1.2 - Auguset 11th, 2014
o Fixed some undefined language string errors found in mod
o Modified code to insert attachments after pressing "More Attachments" in Posts and PMs
Title: Re: Post and PM Inline Attachments
Post by: Sweetwater on August 16, 2014, 08:46:48 AM
A great idea for a mod. However I'm having same problem as above after installing v1.2 on smf 2.08

Can only add one attachment now, but the first attachment inserts exactly as described. Attempt to add more attachments it jumps to top of page and nothing else. Same as when editting a post and trying to add another attachment.

A great attempt at a good idea, thanks for your efforts but will need to uninstall on my forum.

Kind regards
Title: Re: Post and PM Inline Attachments
Post by: saurabh1938 on August 16, 2014, 06:04:25 PM
This is the MOD that is most important for my forum. I am eagerly waiting for the bug fix... Currently after the fresh install, when I click on more attachment, it takes me to somewhere else. I am looking forward for the bug fix and refreshing this page every couple of hours. Please let me know by when you would be able to fix this thing.... but superb effort and appreciate your help.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 16, 2014, 09:22:13 PM
Sigh...  :o Damn....  I thought I took care of this issue  ???  Lemme look into it again.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 17, 2014, 08:32:05 AM
Uploaded v1.3 - August 17th, 2014
o Fixed javascript code for issue with pressing "More Attachments" in Posts.

Thank you for the bug reports, grimmoire, Sweetwater and saurabh1938!!  I overlooked one stupid little variable in Post.template.php, which was why it wasn't working.  Amazingly, I had fixed it on my localhost forum, but forgot to transcribe my changes back into the install.xml file....
Title: Re: Post and PM Inline Attachments
Post by: saurabh1938 on August 17, 2014, 05:23:57 PM
Thanks for the fix! It is working great

One thing I want point out here is: It is working great on Internet Explorer ... but it is not working on Chrome.

On Chrome when I click on (Insert Attachment n), Nothing happens. Please look into this issue as well, as most of the users use chrome these days..

Anyways I want to thank you for this MOD as my forum is based on Photos and its a very important MOD for me.
Title: Re: Post and PM Inline Attachments
Post by: marcosdjcm on August 19, 2014, 07:39:10 AM
Hi,

I like the idea of this mod but I am getting inline links instead of inline images:

(http://i.imgur.com/5LSl2lY.png)

(http://i.imgur.com/MZm2Ary.png)

Am I doing something wrong? Would like the image to be displayed inline like I have done in this post. Thanks.
Title: Re: Post and PM Inline Attachments
Post by: saurabh1938 on August 19, 2014, 11:33:48 AM
when you post this message you will see the image, while in edit mode, it looks like this only.

Btw which browser are you using?
Quote from: marcosdjcm on August 19, 2014, 07:39:10 AM
Hi,

I like the idea of this mod but I am getting inline links instead of inline images:

(http://i.imgur.com/5LSl2lY.png)

(http://i.imgur.com/MZm2Ary.png)

Am I doing something wrong? Would like the image to be displayed inline like I have done in this post. Thanks.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 20, 2014, 04:39:00 PM
Can you attach the image in question?  This way, I can look at the problem with that particular attachment.....
Title: Re: Post and PM Inline Attachments
Post by: saurabh1938 on August 20, 2014, 06:28:57 PM
Quote from: dougiefresh on August 20, 2014, 04:39:00 PM
Can you attach the image in question?  This way, I can look at the problem with that particular attachment.....

Hi, would you be able to look at the issue of this mod not working on Chrome or Firefox. When I click on Insert Attachment, nothing happens but on IE it works like a charm

Thanks,
Saurabh
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 20, 2014, 06:46:32 PM
I will look into it.  Sorry about not responding to your earlier message....
Title: Re: Post and PM Inline Attachments
Post by: saurabh1938 on August 21, 2014, 04:14:31 PM
Quote from: dougiefresh on August 20, 2014, 06:46:32 PM
I will look into it.  Sorry about not responding to your earlier message....

Thanks in advance, for taking out the time and looking into the issue. As I mentioned earlier, this MOD and hence your help is very crucial for my forum. I am eagerly awaiting a fix.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 21, 2014, 05:04:41 PM
Quote from: marcosdjcm on August 19, 2014, 07:39:10 AM
Hi,

I like the idea of this mod but I am getting inline links instead of inline images:

Am I doing something wrong? Would like the image to be displayed inline like I have done in this post. Thanks.
This mod uses the attachment data provided by the core forum software in order to decide how to display the attachment.  If the attachment is NOT an image, what you get is the text/link that you got.  If the attachment IS an image, then you should see the image in the post.  However, my code is not responsible for determining whether or not the attachment is an image or not.  That responsibility falls to the core forum software.  The fact that the core forum software does not recognize the image as such suggests that the image in question is corrupt OR not encoded in such a way that the core forum software can process it as an image.
Title: Re: Post and PM Inline Attachments
Post by: allkary on August 22, 2014, 09:26:07 AM
Hello, I get some warnings when installing the mod and when attaching the fails it says "[ Invalid Attachment ] "
Thanks for your time :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 22, 2014, 07:33:19 PM
Quote from: saurabh1938 on August 20, 2014, 06:28:57 PM
Hi, would you be able to look at the issue of this mod not working on Chrome or Firefox. When I click on Insert Attachment, nothing happens but on IE it works like a charm
I tested it in FireFox during development of the mod, and tested it in Chrome just now.  I don't see where it doesn't function properly.  When I press the "Insert Attachment" link beside the attachment, the text "[attachment=0][/attachment]" gets inserted into the post....

Quote from: marcosdjcm on August 19, 2014, 07:39:10 AM
I like the idea of this mod but I am getting inline links instead of inline images:

Am I doing something wrong? Would like the image to be displayed inline like I have done in this post. Thanks.
No, I think the problem resides in the Subs-InlineAttachment.php code.  I've done some rewriting of the code for v1.4, but it is attached if you want to replace your file in the Sources folder....  Lemme know if this solves your problem.  Thanks!
Title: Re: Post and PM Inline Attachments
Post by: saurabh1938 on August 23, 2014, 06:15:54 AM
Quote from: dougiefresh on August 22, 2014, 07:33:19 PM
Quote from: saurabh1938 on August 20, 2014, 06:28:57 PM
Hi, would you be able to look at the issue of this mod not working on Chrome or Firefox. When I click on Insert Attachment, nothing happens but on IE it works like a charm
I tested it in FireFox during development of the mod, and tested it in Chrome just now.  I don't see where it doesn't function properly.  When I press the "Insert Attachment" link beside the attachment, the text "[attachment=0][/attachment]" gets inserted into the post....


Hi, I appreciate you looked into the issue, but I tested this on 3-4 machines, it is only working on IE but not on Firefox, Safari, Chrome... I don't know what's happening but issue persists for all the browsers other than IE.

Thanks,
Saurabh
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 24, 2014, 06:34:09 AM
I would love to fix it, but I can't fix something that I can't reproduce.....  When you click the More Attachments link, does it work?  If not, that suggests that Javascript isn't enabled for your browser....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 24, 2014, 08:13:05 AM
Uploaded v1.4 - August 23th, 2014
o Fixed multiple issues in the inline attachment validation function.
Title: Re: Post and PM Inline Attachments
Post by: marcosdjcm on August 26, 2014, 03:54:15 AM
Hi, thanks for making this mod, I am having 1 problem with it.

It inserts the link to the attachment in the post but doesn't actually display the image, maybe I'm missing an option somewhere? I want it to display the same way I've attached the images below:

(http://i.imgur.com/5LSl2lY.png)

(http://i.imgur.com/MZm2Ary.png)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 26, 2014, 04:36:28 PM
Attach the image to your post so that I can see what the problem is with the mod.  If you don't, I'm going to assume that you have a corrupted image.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 27, 2014, 01:45:27 PM
You could also upload the image somewhere and PM the location of the image if it's a image of a "sensitive" nature....  Just warning me in your PM if that's the case.
Title: Re: Post and PM Inline Attachments
Post by: saurabh1938 on August 28, 2014, 05:50:29 PM
Hi Appreciate your effort in building this great Idea. But somehow it is not compatible with my site's settings... As my forum is not live, I started again from a scratch to install your mod at the beginning. At start it was working fine on all browsers but as I filled it up with other mods and contents and configured settings, it again stopped working on all other browsers except Internet Explorer.

So, In the end I had to uninstall your mod after scratching my brains for 4-5 days. But still a great Idea, somehow it didn't work for me and had to install another ILA mod compatible with my site

Thanks,
Saurabh
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 29, 2014, 03:17:01 PM
If you tell me what mods you are running, I might be able to track down your incompatibility....
Title: Re: Post and PM Inline Attachments
Post by: saurabh1938 on September 01, 2014, 06:13:21 PM
Though I have installed another mod for ILA and it is working very fine for me, but still you helped me and put in your efforts. I wish you luck that your mod does great and you track down the issue.

Below is the screenshot showing the mods I am using
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 05, 2014, 09:28:48 PM
@saurabh1938: Can you at least tell me what inline attachment mod you are using now?  Maybe I can learn something from it......
Title: Re: Post and PM Inline Attachments
Post by: saurabh1938 on September 10, 2014, 02:24:36 PM
I am using this ILA Mod...  it's not listed on this site

https://github.com/Spuds/SMF-ILA
Title: Re: Post and PM Inline Attachments
Post by: thelastlokean on October 11, 2014, 03:02:54 PM
It works for me, which is great! The one in the OP, not the one above...  I really think this adds a lot to SMF!  I don't want my users to have to handle hosting their own images, and I haven't seen another mod that integrates image uploads directly into posts!  Has a couple issues/glitches though...  For now I'll be using it anyways.

First off, it doesn't work at all with a WYSIWYG editor.  That is fine that it doesn't show the image, but if your in WYSIWYG mode of the SMF editor, it will not put the [attachment=n][/attachment] code into the editor.  I don't really care if the content actually shows in the WYSIWYG editor, but it would be really nice if it added the code and the editor just let it be... 

Also SCeditor is going to be in 2.1 I hear, and this doesn't seem to work at all with SCeditor no matter what mode you are using it in.

Also if you toggle from source to WYSIWYG mode, any added [attachment] BBCodes disappear and have no effect on the resulting post.

It seems to work fine with all other BBCodes, even custom ones like the 'spoiler' mod and default things like 'glow' and 'shadow', where the BBCode is shown, not its result in the WYSIWYG editor just like in the normal editor.

Last issue, it doesn't show the image in the 'preview' section.  It would really be helpful for proper image sizing with the 'height' and 'width' features if it actually showed the image in the preview window.  Unfortunately it only seems to show the BBCode... Resulting in users with OCD needing to edit posts multiple times to get everything just perfect.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 06, 2014, 08:37:40 AM
Uploaded v1.5 - December 6th, 2014
o Fixed attachments not being hidden after use in post with Custom View of Attachments (http://custom.simplemachines.org/mods/index.php?mod=2758) installed.

@thelastlokean: I'm sorry for the late response.  I'll start looking into the issues reported in this thread.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 06, 2014, 07:41:24 PM
Update: Okay, I've gotten the preview thing in "source" mode (not WYSIWYG mode) to work, but at the moment, it is only for attachments that have been saved to a particular topic.  In other words, you can't create a post, attach some files to the post-in-progress, add some attachment tags, and preview it without saving at least once.....

I've also written a new form of the attachment bbcode.  It'll look something like this:
[attachment id={id} width={width} height={height} float={float}][/attachment]
Every parameter except id is optional.  float will float the image to either the left, right or center.  All new "insert attachment x" clicks will use the new form instead of the old form.  Mind you, the old form is still available for backward compatibility....  not to mention keeping my head from exploding from trying to convert all the old forms to the new forms.....

EDIT: This new version will be version 2.0, in case anyone is wondering....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 13, 2014, 01:04:53 PM
Uploaded v2.0 - December 7th, 2014
o Added new form of the attachment bbcode, as explained above.
o Fixed preview capability in non-WYSIWYG mode for already saved attachments in posts...
o Changed code that scales image to use global settings only if no size is specified by the user.
o Modified link building code for HS4SMF so that it properly groups the attachments.
o Added support for Highslide Image Viewer (http://custom.simplemachines.org/mods/index.php?mod=1450).
o Added support for JQLightBox (http://custom.simplemachines.org/mods/index.php?mod=1605).




@Everybody: As stated in the last post, I've written a new form of the attachment bbcode.  It looks something like this:
Quote
[attachment id={id} height={height} float={float}][/attachment]
Every parameter except id is optional.  float will float the image to either the left, right or centerAll new "insert attachment x" clicks will use the new form instead of the old form.  Mind you, the old form is still available for backward compatibility....

I realize that the PM Attachment preview function is still broken, and and the Post Attachment preview functionality cannot display attachments that haven't been "finalized" outside of preview mode.  These will be the next things on my agenda to fix for this mod....  Mind you, these are NOT small changes that will have to be made!!!

Compatibility with SCeditor is also planned, if possible (which it should be....) 

I asked about how to alter SMF's WYSIWYG editor to handle new bbcodes here (http://www.simplemachines.org/community/index.php?topic=530974.msg3770589), and Arantor said the WYSIWYG editor in SMF cannot deal with complex bbcodes, so it looks like making this mod work in WYSIWYG mode in SMF without mods is not possible.....
Title: Re: Post and PM Inline Attachments
Post by: Arantor on December 13, 2014, 03:20:01 PM
Seriously... SMF's editor doesn't even handle all its OWN bbcode properly, and good luck adding more to it...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 19, 2014, 02:48:11 PM
Uploaded v2.1 - December 19th, 2014
o New BBCodes added: attach, attachthumb, and attachmini.
o Some reorganization of the code to accommodate the new BBCodes.
o Image not scaled if both width and height are specified.
o Parameter validation functions fixed to prevent negative values from being passed.
o No highslide features if image size is smaller than specified max image dimensions.
o Fixed image placement code by removing "block_level" requirements from all BBcodes...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 23, 2014, 03:54:15 PM
Uploaded v2.2 - December 22th, 2014
o New BBCode added: attachurl
o margin parameter allowed to be used seperate from the float parameter.
o Fixed the code creating the float parameter so that it works (again)
o Fixed attachmini bbcode to return a blank string if attachment is not an image.
o Added scale parameter to v2.x bbcodes, accepting false, true, yes, and no.
Title: Re: Post and PM Inline Attachments
Post by: RSI on December 27, 2014, 01:27:07 PM
Hello,

I'm using SMF 2.0.7 and I installed your pervious version 2.1 a couple of weeks ago and I'm getting the error in the error log below.

I've had Highslide installed since last spring and when I place images inline with your mod the inline images work fine with Highslide.

I don't know why I'm getting the errors though? I saw it again yesterday and it said line 469. This time it's line 470.

It looks like its happening each time I insert an image inline. It generates the error even though the images are inline and Highslide works with them fine.

I want to correct this... How?  Is there a "Subject" line missing in the Modifications.english.php file or something?

mydomain.com/index.php?action=post2;start=25;board=8

8: Undefined index: subject

File: /home/me/public_html/Sources/Subs-InlineAttachments.php
Line: 470
Title: Re: Post and PM Inline Attachments
Post by: RSI on December 27, 2014, 04:23:28 PM
Strange..., I took the latest Subs-InlineAttachments.php file from your v2.2 and overwrote the one I was using from v2.1 and it fixed the problem.

Looks like you added some to that file just recently ???
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 27, 2014, 07:04:51 PM
Quote from: RSI on December 27, 2014, 04:23:28 PM
Strange..., I took the latest Subs-InlineAttachments.php file from your v2.2 and overwrote the one I was using from v2.1 and it fixed the problem.

Looks like you added some to that file just recently ???
Yeah, I fixed something about the mod and, off the top of my head, I can't remember what I exactly fixed.  I remember something about undeclared variables or something-or-other and what you listed sounds like it was one of the issues I found with the mod during a live test on my own website....
Title: Re: Post and PM Inline Attachments
Post by: RSI on December 28, 2014, 10:11:01 AM
Is there anyway to remove the space between the inline image and the download link and counter?

Normally it's right underneath the image, but its adding a space for some reason.

Other than that everything works fine now.

See an example of what I'm getting attached below...

Title: Re: Post and PM Inline Attachments
Post by: RSI on December 28, 2014, 12:28:51 PM
I found it...

Don't know if it was an intentional personal preference thing or just a carryover that was missed but there is a <br /> and a <br/> in the Subs-InlineAttachments.php code below.

Removing the one last <br/> solves it and the links are displayed right under images now. I removed both of them.

Find
// Highslide Image Viewer Installed?
elseif (function_exists('highslide_images'))
$html = '<a href="' . $image . ';image" id="link_' . $id . '" class="highslide" rel="highslide"><img src="' . $thumb . '" ' . $width . $height . ' alt="' . $attachment['name'] . '"' . $float . $margin . ' id="thumb_' . $id . '" /></a><br /><span class="highslide-heading">' . $context['subject'] . '</span>';
// jQLightbox
elseif (!empty($modSettings['enable_jqlightbox_mod']) && strpos($context['html_headers'], 'jquery.prettyPhoto.css'))
$html = '<a href="' . $image . ';image" id="link_' . $id . '" rel="lightbox[gallery]"><img src="' . $thumb . '" ' . $width . $height . ' alt="' . $attachment['name'] . '"' . $float . $margin . ' id="thumb_' . $id . '" /></a>';
// Simple Mode
else
$html = '<img src="' . $thumb . ';image" alt=""' . $width . $height . ' alt="' . $attachment['name'] . '"' . $float . $margin . ' class="bbc_img resized" />';
}
else
$html = '<img src="' . $thumb . ';image" alt=""' . $width . $height . ' alt="' . $attachment['name'] . '"' . $float . $margin . ' class="bbc_img resized" />';

// Add the download count to the image tag if requested:
if (!empty($modSettings['ila_download_count']) && $tag['tag'] != 'attachmini')
$html .= '<br/><div class="smalltext"><a href="' . $image . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ('. $attachment['size']. ($attachment['is_image'] ? '. ' . $src_width . 'x' . $src_height . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)</div>';


Replace with
// Highslide Image Viewer Installed?
elseif (function_exists('highslide_images'))
$html = '<a href="' . $image . ';image" id="link_' . $id . '" class="highslide" rel="highslide"><img src="' . $thumb . '" ' . $width . $height . ' alt="' . $attachment['name'] . '"' . $float . $margin . ' id="thumb_' . $id . '" /></a><span class="highslide-heading">' . $context['subject'] . '</span>';
// jQLightbox
elseif (!empty($modSettings['enable_jqlightbox_mod']) && strpos($context['html_headers'], 'jquery.prettyPhoto.css'))
$html = '<a href="' . $image . ';image" id="link_' . $id . '" rel="lightbox[gallery]"><img src="' . $thumb . '" ' . $width . $height . ' alt="' . $attachment['name'] . '"' . $float . $margin . ' id="thumb_' . $id . '" /></a>';
// Simple Mode
else
$html = '<img src="' . $thumb . ';image" alt=""' . $width . $height . ' alt="' . $attachment['name'] . '"' . $float . $margin . ' class="bbc_img resized" />';
}
else
$html = '<img src="' . $thumb . ';image" alt=""' . $width . $height . ' alt="' . $attachment['name'] . '"' . $float . $margin . ' class="bbc_img resized" />';

// Add the download count to the image tag if requested:
if (!empty($modSettings['ila_download_count']) && $tag['tag'] != 'attachmini')
$html .= '<div class="smalltext"><a href="' . $image . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ('. $attachment['size']. ($attachment['is_image'] ? '. ' . $src_width . 'x' . $src_height . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)</div>';

// Clear the parameter set for the next usage and return string to caller:
unset($context["ila_params"]);
return $html;
}
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 28, 2014, 06:58:50 PM
Uploaded v2.3 - December 28th, 2014
o Performance enhancement due to storing permission check after first check.
o Fixed spacing issues between picture and download counter/link.  Thanks, RSI (http://www.simplemachines.org/community/index.php?action=profile;u=399264)!
Title: Re: Post and PM Inline Attachments
Post by: RSI on December 28, 2014, 07:14:45 PM
Hey, thank you very much for creating and updating this mod. I've been waiting for someone to finally do it!!!

I tied using the HS4 and ILA mods a while back, but I already had the Highslide mod installed and modified at the time and there were conflicts trying to add them after.

Anyway, this should be a standard feature built-into SMF period!!! I cannot really say anything more other than this one looks like it belongs with it.

Again, thanks...!!!




Title: Re: Post and PM Inline Attachments
Post by: tranhiep_116 on December 28, 2014, 07:30:44 PM
 thanks you very much for creating and updating this mod. I will using it for my smf ;D
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 28, 2014, 07:32:44 PM
You're welcome! 

@RSI:  I agree with ya, but I have very serious doubts that SMF will ever incorporate this into the core code....  You never know, though....
Title: Re: Post and PM Inline Attachments
Post by: RSI on January 11, 2015, 04:16:40 PM
Hi,

I wanted to give you an update on this. With version 2.2 installed I was still occasionally getting the errors and it it only happened on uploads where the server traffic or something appeared to be a little high when the uploads were slow. And when it happened it was always with a different line in the Subs-InlineAttachments.php file.

I recently uploaded the new 2.3 version of then Subs-InlineAttachments.php file and now it happens again every single time again, but it's always the same line now, line 523.

The error I get is below. Any idea on how to correct this?

http://mydomain.com/index.php?action=post2;start=25;board=7

8: Undefined index: subject

File: /home/me/public_html/Sources/Subs-InlineAttachments.php

Line: 523
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 11, 2015, 05:02:40 PM
Uploaded v2.4 - January 11th, 2015
o Fixed undefined index error within Subs-InlineAttachments.php...

@RSI: This update should solve the issue you reported.  Thank you for the bug report!
Title: Re: Post and PM Inline Attachments
Post by: RSI on January 12, 2015, 10:02:41 AM
K, that fixed it... Thanks...

Now I can just leave it alone for the next several years 8)

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 19, 2015, 09:42:42 AM
Uploaded v2.5 - January 19th, 2015
o License change to Simplified BSD.  No functionality change.
Title: Re: Post and PM Inline Attachments
Post by: RSI on January 19, 2015, 11:03:39 AM
Hi, there is a problem with IE or at least with IE11. The images do not display. You can see the placeholders and when you click on them they pop up fine and display if using Highslide, but the in-line images are not displaying within posts themselves.

I never checked it on IE before and all I have is IE11 so I'm not sure if it also effects IE10, 9, etc. but it's definitely a big problem if using IE11. I had a couple of users complain so I just looked at it and can see the problem. I even tried using compatibility mode and it starts to resize the images properly when doing that, but you still only see the placeholders. Everything is fine when using Safari or Firefox, just not with IE11 and possibly earlier.

P.S. I just manually went through and updated to the latest version 2.5 and it's still the same, wont display the images in-line with IE11. Can only see the placeholders.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 19, 2015, 06:32:31 PM
Lemme look into this issue...
Title: Re: Post and PM Inline Attachments
Post by: RSI on January 19, 2015, 08:18:27 PM
Update, it's doing the same thing with IE8. Hope that helps...

Title: Re: Post and PM Inline Attachments
Post by: Arantor on January 19, 2015, 08:34:12 PM
I haven't dug into the mod... but related question: when you serve attachments, are you serving them through dlattach? More importantly... when you serve the attachment, do you have the correct Content-Type header being sent? IE8+ will choke on a file when there is an incorrect/missing content-type header declaration versus what the file contains. E.g. if you serve it a picture, the Content-Type needs to match the picture otherwise IE will refuse to show the picture. (Even if you tell it the image is a JPEG when the file is really a PNG for example)
Title: Re: Post and PM Inline Attachments
Post by: RSI on January 20, 2015, 10:08:07 AM
Below is an example of what's being sent to the browser.

<a href="http://mydomain.com/index.php?action=dlattach;topic=207.0;attach=1173;image" id="link_0" class="highslide" rel="highslide"><img src="http://mydomain.com/index.php?action=dlattach;topic=207.0;attach=1173" &nbsp;width="300" height="183" alt="RF_Deck_Mod_01.png" id="thumb_0"></a>

<span class="highslide-heading">My Topic</span>

<div class="smalltext"><a href="http://mydomain.com/index.php?action=dlattach;topic=207.0;attach=1173"><img src="http://mydomain.com/Themes/default/images/icons/clip.gif" align="middle" alt="*" border="0">&nbsp;RF_Deck_Mod_01.png</a> (79.38 kB. 300x183 - viewed 352 times.)</div>


I don't have anything earlier than IE8 so I don't know about IE7, but its probably a pretty safe bet to assume it's not working from IE8 on up to IE11. It's doing the exact same thing on IE8 and IE11 both.

I remember all of those different Content-Type headers for IE a while back and some where on the main index page or template, but I think those were all eventually removed, right? I assume you are talking about adding them somewhere else for this mod...?
Title: Re: Post and PM Inline Attachments
Post by: Arantor on January 20, 2015, 10:28:45 AM
Yes, I'm not talking about anything on the page itself that you're looking at, I'm talking about the physical request/response for actually sending the file.

As a temporary test to prove whether this is the root cause, take a look in the top level index.php file.

You'll see this line:
header('X-Content-Type-Options: nosniff');

If you remove that line temporarily and try it again, does it work?
Title: Re: Post and PM Inline Attachments
Post by: RSI on January 20, 2015, 10:55:30 AM
Quote from: Arantor on January 20, 2015, 10:28:45 AM
Yes, I'm not talking about anything on the page itself that you're looking at, I'm talking about the physical request/response for actually sending the file.

As a temporary test to prove whether this is the root cause, take a look in the top level index.php file.

You'll see this line:
header('X-Content-Type-Options: nosniff');

If you remove that line temporarily and try it again, does it work?

Yep, it's works if I comment out that line ;)
Title: Re: Post and PM Inline Attachments
Post by: Arantor on January 20, 2015, 10:59:49 AM
Yes, I rather suspect that was the cause.

So at this point, this makes me wonder if the mod is properly serving Content-Type because that line indicates IE is supposed to check what the supplied data from the server was, against what the server said it was sending.

I still haven't checked the mod but this could be mod related.
Title: Re: Post and PM Inline Attachments
Post by: RSI on January 27, 2015, 11:03:43 AM
Any update on this?

I went ahead and bit the bullet and did the SMF 2.0.9 upgrade after removing all of the hooks and did a clean install keeping all data intact. I then tried installing this mod again and it still wont display the in-line images in IE8 to IE11 so it is this mod.

Anyway, I then removed it and installed the ILA mod and it works correctly with IE. The only problem is it wont work with the PM Attachments mod and the HS4SMF v0.8 mod is a little out of date. Some of the selected features via the admin panel don't work correctly anymore.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 28, 2015, 04:24:27 AM
Quote from: Arantor on January 20, 2015, 10:59:49 AM
Yes, I rather suspect that was the cause.

So at this point, this makes me wonder if the mod is properly serving Content-Type because that line indicates IE is supposed to check what the supplied data from the server was, against what the server said it was sending.

I still haven't checked the mod but this could be mod related.
Well, I am using SMF's native attachment handling code in order to serve the attachments to the user.  I haven't made any adjustments to the attachment serving code in my mod, so I don't understand what is going on here....  As a temporary measure, I'm going to add an option to the mod to disable the nosniff setting done by the forum.

I have a feeling I'm going to need to change the headers sent for the mod to reflect the actual filetype instead of the application/octetstream type that SMF sends, which is what back to SMF 2.0.5 has in the code....
Title: Re: Post and PM Inline Attachments
Post by: Arantor on January 28, 2015, 04:34:26 AM
No, SMF only uses application/octetstream if it's not an image. If it is an image and can be detected as such, the proper image MIME type is used instead.

This is what the problem is; IE is detecting a mismatch between what the declared MIME type is and what it discovers when it tries to open the file.

This could suggest there is something about the saving part that is not being handled completely.
Title: Re: Post and PM Inline Attachments
Post by: RSI on January 28, 2015, 11:33:12 AM
Here's a link which explains it. It started with IE8

https://technet.microsoft.com/en-us/library/dd919181%28v=WS.10%29.aspx

MIME-handling changes. The following changes are made to the Internet Explorer 8 Multipurpose Internet Mail Extensions (MIME)-type detection algorithms:

Restrict MIME-type detection. Internet Explorer 8 prevents the detection, or data sniffing, of files with image/* MIME content types into HTML or script. If a file contains script and the server declares that it is an image file, Internet Explorer 8 does not run the embedded script.

Prevent MIME-type detection. Web applications now can prevent MIME-type detection. Sending the new X-Content-Type-Options: nosniff header prevents Internet Explorer from using MIME-type detection to change the server-declared content type.

Force save. For Web applications that need to serve untrusted HTML files, Internet Explorer 8 contains a mechanism that forces users to save untrusted HTML files locally before opening to help prevent the untrusted content from compromising site security.
Title: Re: Post and PM Inline Attachments
Post by: Arantor on January 29, 2015, 08:44:27 AM
Yes, yes I know this much. I'm the guy who inserted the nosniff header *into* SMF in the first place (because I'm formerly of the dev team). And of course this is how I knew to suggest whether that was a possible cause.

The question is why the attachment serving is not sending the correct MIME type, which suggests the wrong MIME type is being saved in the first place, which would potentially be a mod issue but I have not had the time or energy to figure out what's wrong with the mod (seeing how it's not mine)
Title: Re: Post and PM Inline Attachments
Post by: shazoo! on February 01, 2015, 09:57:45 AM
Quote from: saurabh1938 on August 23, 2014, 06:15:54 AM
Quote from: dougiefresh on August 22, 2014, 07:33:19 PM
Quote from: saurabh1938 on August 20, 2014, 06:28:57 PM
Hi, would you be able to look at the issue of this mod not working on Chrome or Firefox. When I click on Insert Attachment, nothing happens but on IE it works like a charm
I tested it in FireFox during development of the mod, and tested it in Chrome just now.  I don't see where it doesn't function properly.  When I press the "Insert Attachment" link beside the attachment, the text "[attachment=0][/attachment]" gets inserted into the post....


Hi, I appreciate you looked into the issue, but I tested this on 3-4 machines, it is only working on IE but not on Firefox, Safari, Chrome... I don't know what's happening but issue persists for all the browsers other than IE.

Thanks,
Saurabh
Quote from: dougiefresh on August 24, 2014, 06:34:09 AM
I would love to fix it, but I can't fix something that I can't reproduce.....  When you click the More Attachments link, does it work?  If not, that suggests that Javascript isn't enabled for your browser....
I'm experiencing the same issue with Chrome and Firefox, but it works great in IE

When I click on the insert attachment links, nothing happens.

If I inspect element in Chrome, I see the following in the console (not sure if this is helpful or not... it may not even be applicable to the issue):

JQMIGRATE: jQuery.fn.live() is deprecated
jquery.caret.min.js:2 'Range.detach' is now a no-op, as per DOM (http://dom.spec.whatwg.org/#dom-range-detach).

Also, if I try to manually add the BBC code in the message in Chrome or Firefox:

[attachment=0][/attachment]

It will show in the preview if I toggle the format, but is removed as soon as I hit save
Title: Re: Post and PM Inline Attachments
Post by: RSI on February 06, 2015, 05:43:34 PM
Quote from: shazoo! on February 01, 2015, 09:57:45 AM
this mod not working on Chrome or Firefox. When I click on Insert Attachment, nothing happens but on IE it works like a charm

What, that makes no sense at all...
Title: Re: Post and PM Inline Attachments
Post by: shazoo! on February 06, 2015, 05:54:51 PM
Quote from: RSI on February 06, 2015, 05:43:34 PM
Quote from: shazoo! on February 01, 2015, 09:57:45 AM
this mod not working on Chrome or Firefox. When I click on Insert Attachment, nothing happens but on IE it works like a charm

What, that makes no sense at all...
Agreed, but that's what I'm experiencing
Title: Re: Post and PM Inline Attachments
Post by: RSI on February 07, 2015, 11:33:50 AM
QuoteAgreed, but that's what I'm experiencing

What version of SMF are you using? With a clean v2.09 install it works fine on all other browser's except IE8 thru IE11.

You either have an older SMF version or it's related to other mods you have installed.

Title: Re: Post and PM Inline Attachments
Post by: RSI on February 09, 2015, 02:05:12 PM
You know, it might be better to just wait until the SMF production version of v2.1 is released. I never planed on upgrading from v2.07 to v2.09 and I only did it because I was trying to figure out want was going on with this mod. After playing with v2.1 b1 this weekend and the fact it's making the switch to HTML5 changes everything. This browser compatibility thing may be eliminated anyway.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 13, 2015, 08:16:33 AM
Uploaded v2.6 - February 13th, 2014
o Added an option to disable the nosniff header until a better solution is found....
o Fixed a bug in the Post.template.php and PersonalMessage.template.php templates regarding adding more attachments.
o Fixed a bug that added "Insert Attachment 1" where "Insert Attachment 2" should have been.




@shazoo!: I have managed to duplicate your bug report and have corrected the bug within the mod.  Thank you for the bug report!

Everybody: I can no longer update the first post in my threads....
Title: Re: Post and PM Inline Attachments
Post by: josx2 on February 18, 2015, 02:54:03 AM
sorry for the total newb question (i'm just getting started w/ SMF)...I've got v.2.5 of this installed on my forum.  How do I go about updating the package to 2.6?  This is my first update for a package I have installed, so I'm clueless.   I tried searching for upgrade instructions in here & on google & no luck.  Don't know if I can just install on top of my 2.5, or if I gotta remove 2.5 first.

Thx for the help.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 18, 2015, 05:19:42 AM
You will have to remove v2.5 first, then you will be able to install v2.6 on your forum.  Hope this helps!
Title: Re: Post and PM Inline Attachments
Post by: josx2 on February 18, 2015, 08:08:08 AM
Cool... Thanks!
Title: Re: Post and PM Inline Attachments
Post by: ChILd_ReBoRn on March 05, 2015, 04:34:39 PM
the problem is that the upload script generates attachment names as in attachment 0, attachment 2, attachment 3... The "1" is missing, and when you press post, the last attachment  goes bust. The solution is to change the attachment numbers IN POST  in order 0, 1, 2, 3, 4.....Then it works like a charm
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 08, 2015, 07:40:03 PM
Hmmm.... I'll look into this bug report....
Title: Re: Post and PM Inline Attachments
Post by: ChILd_ReBoRn on March 10, 2015, 05:10:09 PM
Please..do.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 12, 2015, 04:54:36 PM
Uploaded v2.7 - March 12th, 2015
o Changed some code to correctly count the number of existing attachments.




@ChILd_ReBoRn:  Thanks for the bug report.  I wasn't able to reproduce the bug with only one attachment, but with two, the bug appeared.  The update should fix the bug.  I apologize for taking so long, as I've been working WAY too many works at work....
Title: Re: Post and PM Inline Attachments
Post by: ChILd_ReBoRn on March 12, 2015, 06:21:24 PM
I just restored my forum to an earlier backup, and I tried to reinstall your mod, and I got a bunch of errors. I haven't had nay problems last time I installed them. Here is the print scr of some errors... (never mind the language.. the red ones are bad :))

word "zamijeni" means "replace"
word "Neuspješno" means "failed"
Title: Re: Post and PM Inline Attachments
Post by: ChILd_ReBoRn on March 13, 2015, 03:49:18 AM
any help on the subject? anyone?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 13, 2015, 09:36:28 AM
I strongly suspect that your forum backup had a previous version of the mod already installed.  The operations that have failed during installation are ones that REPLACE portions of your files, whereas the operations that succeed have operations that insert stuff either BEFORE or AFTER portions of code.

The only way to "fix" this is to uninstall the previous version OR restore the code manually back to the original code (if possible), then install the latest version....
Title: Re: Post and PM Inline Attachments
Post by: ChILd_ReBoRn on March 13, 2015, 11:15:04 AM
no it didn't. I made the backup PRIOR to the mod installment. I'm not sure what the original code is :/
Title: Re: Post and PM Inline Attachments
Post by: ChILd_ReBoRn on March 13, 2015, 12:10:53 PM
made it!

the updated version works like a charm..

I just had to upload back up of those red PHP files...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 13, 2015, 01:54:17 PM
I'm happy to hear that!  Thanks!
Title: Re: Post and PM Inline Attachments
Post by: Jamie87100 on March 14, 2015, 09:06:00 AM
Hi,

This looks like a great mod and i really need to be able insert in-line images but i am getting the attached errors when trying to install this mod.

Is there a way to get this working?
I am using SMF 2.0.9

Is it a case of making all the edits manually?

Cheers,
Jamie
Title: Re: Post and PM Inline Attachments
Post by: ChILd_ReBoRn on March 14, 2015, 09:36:47 AM
Delete the problematic files, and rename the ones with a tilda (~). They will replace the peoblematic ones. It worked like a charm for me
Title: Re: Post and PM Inline Attachments
Post by: Jamie87100 on March 14, 2015, 09:50:00 AM
Thank you for your reply, I just tried that but still getting the same error when i go to install it
Title: Re: Post and PM Inline Attachments
Post by: Jamie87100 on March 14, 2015, 11:56:33 AM
I have it installed now (i tried the install again and no errors came up, strange?) but i have the same issue others have too where clicking Insert Attachment doesn't do anything.

I have the following mods installed.

Pretty URLs
FancyBox 4 SMF
ENotify
SCEditor4Smf

Cheers
Jamie




EDIT:


It is working now but i have had to remove SCEditor and change the post type back to the standard editor rather than the WYSIWYG editor for it to work.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 14, 2015, 07:30:39 PM
@Jamie87100: I think you've got the wrong thread.  My mod doesn't have a French translation, nor does the pic show any modifications to PersonalMessage.template.php, which my mod has....

Looking at the failed ops in the pic you posted, the files in question are template files.  The operations alter the files which alter the topic display and message posting templates to add the new functionality....  I would think you SHOULD be okay installing the mod, ignoring the errors of the templates....  However, without looking at the mod in question (once again, you aren't installing my mod), I am making an educated guess here....




Quote from: ChILd_ReBoRn on March 14, 2015, 09:36:47 AM
Delete the problematic files, and rename the ones with a tilda (~). They will replace the peoblematic ones. It worked like a charm for me
@ChILd_ReBoRn: I would say that your advise is not only incorrect, but potentially forum-breaking.  The files with a tilde are backups made before a mod that modifies that particular file.  By restoring an older version of the file to your forum without understanding what changed, you risk breaking your forum.....  The fact that it worked for you is almost PURE luck and I cannot advise using this method.
Title: Re: Post and PM Inline Attachments
Post by: ChILd_ReBoRn on March 15, 2015, 03:11:36 AM
Luck, or not...it worked,and I needed the files before the mod. After restoring the sql prior to installement of your mod, I couldn't install it again. the attachment field under the reply window was there, but nothing worked, the attachment wasn't posted. After restoring the files marked red in above mentioned method..the installation of your mode gave no errors, and it works as it should.
Title: Re: Post and PM Inline Attachments
Post by: Jamie87100 on March 15, 2015, 08:01:22 AM
Quote from: dougiefresh on March 14, 2015, 07:30:39 PM
@Jamie87100: I think you've got the wrong thread.  My mod doesn't have a French translation, nor does the pic show any modifications to PersonalMessage.template.php, which my mod has....

Looking at the failed ops in the pic you posted, the files in question are template files.  The operations alter the files which alter the topic display and message posting templates to add the new functionality....  I would think you SHOULD be okay installing the mod, ignoring the errors of the templates....  However, without looking at the mod in question (once again, you aren't installing my mod), I am making an educated guess here....

Please forgive me, it would appear i have been getting confused between 2 mods however i do have an issue with this one if you can help.
It has installed without any errors and i can see the inert attachment link when posting however clicking it does nothing when i have SCEditor installed.

Is there something i can do to fix this?

On a side note, it does work without SCEditor installed but only in text mode, it never works with the WYSIWYG mode.

Regards,
Jamie
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 16, 2015, 07:51:14 PM
Well, my mod doesn't work with SMF's WYSIWYG mode.  It's unlikely that I'll figure out a way to adapt it....  unless I do  :P

As for compatibility with SCEditor, I haven't looked into compatibility with that mod yet.
Title: Re: Post and PM Inline Attachments
Post by: Jamie87100 on March 16, 2015, 09:00:49 PM
No worries, if you did manage to getting working with SCEditor that would be awesome as I find that editor a lot nicer.

Great work on this mod.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 18, 2015, 07:28:15 PM
Let me see what I can do.  No promises, though....
Title: Re: Post and PM Inline Attachments
Post by: Jamie87100 on March 18, 2015, 07:31:44 PM
Nice  :D

Fingers Crossed
Title: Re: Post and PM Inline Attachments
Post by: paq on March 29, 2015, 06:24:22 PM
Very cool mod dougiefresh! :)
works like a charm on 2.0
On 2.1 beta it kinda works. Let me elaborate.
I got it to operate 'manually'. So after uploading the attachment, manually punch in the attachment tag and then it works.
There are no tick boxes or choices whilst uploading the attachment.
Also on the position of the removed thumbnail remains a image question mark.

Is there any fix for the editor in 2.1?  (and the questionamrk  8) )
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 30, 2015, 09:54:19 AM
@paq: I can fix major parts of the mod to work with SMF 2.1 Beta 1.  However, the file selection part of the new editor also handles multiple files within the same file box.  This makes it REALLY difficult to allow include the "Insert Attachment" text here without knowing which one you are trying to attach to the post.  The only solution that occurs to me is to allow inserting attachments into the post on ones that have already been saved.  This seems like such a lousy way to deal with this situation....  Any thoughts on this?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 30, 2015, 10:00:03 AM
@paq: I can fix major parts of the mod to work with SMF 2.1 Beta 1.  However, the file selection part of the new editor also handles multiple files within the same file box.  This makes it REALLY difficult to allow include the "Insert Attachment" text here without knowing which one you are trying to attach to the post.  In addition, the "add more attachments" link is missing from the post creation/modification template, so that code would obviously have to be dropped in order for this to work...

The only solution that occurs to me is to only allow inserting attachments using the "Insert Attachment" link on ones that have already been saved.  Obviously, adding the inline attachment manually would still work, cause there is nothing stopping you from doing so....  This just seems like such a lousy way to deal with this situation...

EDIT: The OTHER difficulty is that the PM attachments mod hasn't been updated for SMF 2.1 Beta 1 (to my knowledge).  Version 1.6 does NOT work with SMF 2.1 Beta 1 as of this writing....  None of these modifications are required for a mod that won't even install without significant errors during installation....
Title: Re: Post and PM Inline Attachments
Post by: margarett on March 30, 2015, 10:13:12 AM
I would suggest you wait a bit before messing with 2.1 and attachments, there might be some news on the way ;)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 30, 2015, 10:17:19 AM
(sigh)  Very well....
Title: Re: Post and PM Inline Attachments
Post by: paq on March 30, 2015, 10:57:44 AM
Quote from: dougiefresh on March 30, 2015, 10:00:03 AM
@paq: I can fix major parts of the mod to work with SMF 2.1 Beta 1.  However, the file selection part of the new editor also handles multiple files within the same file box.  This makes it REALLY difficult to allow include the "Insert Attachment" text here without knowing which one you are trying to attach to the post.  In addition, the "add more attachments" link is missing from the post creation/modification template, so that code would obviously have to be dropped in order for this to work...

The only solution that occurs to me is to only allow inserting attachments using the "Insert Attachment" link on ones that have already been saved.  Obviously, adding the inline attachment manually would still work, cause there is nothing stopping you from doing so....  This just seems like such a lousy way to deal with this situation...

EDIT: The OTHER difficulty is that the PM attachments mod hasn't been updated for SMF 2.1 Beta 1 (to my knowledge).  Version 1.6 does NOT work with SMF 2.1 Beta 1 as of this writing....  None of these modifications are required for a mod that won't even install without significant errors during installation....

Thanks.
PM attachments where never used on our board, so I focussed on getting the links in the post editor. Which is, as you pointed out, very hard...
And correct: having to explain to users how they need to show their uploaded attachments in their posts will be quite a struggle.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 31, 2015, 06:55:54 PM
UPDATE: Within the next few days, I'll release a new version that will work with SMF 2.1 Beta 1.  You won't be able to use links to attach an image inline into your posts using the upload box, but there is nothing stopping anyone from using the tags anyway.  There will be "insert attachment" tags next to already-uploaded attachments during editing.  I'm also fixing a few issues in the SMF 2.0 install file, as well.  I'll deal with whatever changes that margarett mentioned when they come out....

Also, highslide/lightbox capability will likely not work in SMF 2.1 Beta 1 (without a previously mentioned mod) unless/until I can figure out how to make that work....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 31, 2015, 07:10:34 PM
UPDATE: Within the next few days, I'll release a new version that will work with SMF 2.1 Beta 1.  You won't be able to use links to attach an image inline into your posts using the upload box, but there is nothing stopping anyone from using the tags anyway.  There will be "insert attachment" tags next to already-uploaded attachments during editing.  Also, highslide/lightbox capability will likely not work in SMF 2.1 Beta 1 (without a previously mentioned mod) unless/until I can figure out how to make that work....

I'm also fixing a few issues in the SMF 2.0 install file, as well.  I'll deal with whatever changes that margarett mentioned when they come out....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 04, 2015, 09:51:22 AM
UPDATE: I've got a copy that mostly works on SMF 2.1.  The UI components just don't work and I can't figure out why.  SMF 2.1 Beta 1 and SCeditor mod seems to share a lot of commonalities regarding the editor, so once I figure out the issue with one, I can probably figure out the other shortly thereafter....  It doesn't make sense to release this updated version with so much still broken, as the SMF 2.0 issues aren't major, just very minor visual issues I've figured out how to solve...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 06, 2015, 09:21:50 AM
Okay, I've received a PM offering to test it, so I decided to make this a public test.  Keep in mind this is a BETA version of 2.8, not the final release.

In SMF 2.1 Beta 1, the "Insert Attachments" links do not work.  If you wish to help on this topic, you may offer it in this topic (http://www.simplemachines.org/community/index.php?topic=535345.msg3803647#msg3803647) or in this mod's support topic (which is HERE!)  Also, this mod no longer offers PM attachment support, because the PM attachment mod hasn't been updated for SMF 2.1 Beta 1.  Since I have no idea by who or when it might be updated, PM attachment support has been dropped until that mod is updated.

In SMF 2.0.x, I fixed some visual issues with the mod in the Display.template.php file and PersonalMessage.template.php.  These "issues" came up when there were attachments to the post that are made inline, but the horizontal line was still present.

Happy testing!!!
Title: Re: Post and PM Inline Attachments
Post by: paq on April 06, 2015, 09:41:32 AM
The mod installs perfectly (2.8 Beta 1 on 2.1 Beta 1), and also shows te link, so far so good  8)
Indeed, the link doesn't handle the operations of actually copying the link to the editor. I'll try to fiddle around with that to see if we can get that working somehow.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 06, 2015, 04:25:01 PM
UPDATE: 2.8 Beta 2 is here, with a slight change: An "Inline Attachment" button has been added to the bbcode list at the top of the editor.  The attachment icon used has been copied from the SMF install it installs to (SMF 2.0.x install gets the attachment icon from SMF 2.0.x, etc...)
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on April 12, 2015, 11:52:47 AM
Would it be possible / Any chance of getting the attachments to show on pages like:

index.php?action=profile;area=showposts
index.php?action=profile;area=unreadreplies
index.php?action=profile;area=unread

etc. ?


Kind Regards

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 12, 2015, 04:24:54 PM
I would have to look at the functions involved with those URL calls...  However, I can't fathom any reason out of the blue why it couldn't/wouldn't work....
Title: Re: Post and PM Inline Attachments
Post by: Stanyy on April 13, 2015, 04:04:48 PM
Hi, I think this is a great mod.
But I was wondering if I could modify it to use:

1. [attach=n] instead of [attachment=n][/attachment]
2. id 1 for first attachment instead of 0.

the deprecated ILA mod had these and I was hoping it would be the same. :(
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 13, 2015, 04:11:44 PM
That's one of the issues I was also going to bring up, but just never did.

I'm also currenlty using the ILA mod and when you have 1000+ posts that have attach=n you can't just switch to this mod and make everything that's already using attach=n work with attachment=n.

Why wasn't this mod made to use attach=n ?

That's going to be a big problem when people eventually upgrade to SMF 2.1 when they have 1000+ posts that already use attach=n. If this mod or a new mod is modified to work with v2.1 then what's going to happen if the mod is not using attach=n and uses attachment=n instead?
Title: Re: Post and PM Inline Attachments
Post by: Stanyy on April 13, 2015, 05:42:22 PM
Quote from: RSI on April 13, 2015, 04:11:44 PM
That's one of the issues I was also going to bring up, but just never did.

I'm also currenlty using the ILA mod and when you have 1000+ posts that have attach=n you can't just switch to this mod and make everything that's already using attach=n work with attachment=n.

Why wasn't this mod made to use attach=n ?

That's going to be a big problem when people eventually upgrade to SMF 2.1 when they have 1000+ posts that already use attach=n. If this mod or a new mod is modified to work with v2.1 then what's going to happen if the mod is not using attach=n and uses attachment=n instead?

Hi,
Glad to see someone wants the same thing.
If it was just [attachment=n], i could easily find the files handling that part and remove the 'ment' from it, but it's actually [attachment=n][/attachment] (do you notice the closing tag?). I think it's a bit too long not mentioning that some members may get confused and start putting things in-between the tags. [attach=n] is just perfect, neat and simple.
Also, the issue about using 0 as id of first attachment will also confuse people. It would be perfect though for computer programming forums, but not for the majority.
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on April 13, 2015, 06:34:38 PM
Quote from: dougiefresh on April 12, 2015, 04:24:54 PM
I would have to look at the functions involved with those URL calls...  However, I can't fathom any reason out of the blue why it couldn't/wouldn't work....

Awesome! - Much appreciated if you'd add this in!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 13, 2015, 06:58:18 PM
Quote from: Stanyy on April 13, 2015, 04:04:48 PM
Hi, I think this is a great mod.
But I was wondering if I could modify it to use:

1. [attach=n] instead of [attachment=n][/attachment]2. id 1 for first attachment instead of 0.

the deprecated ILA mod had these and I was hoping it would be the same. :(
I can do the second request easily.  However, I will have to implement yet another option in the settings to change the default behavior of the mod so that I don't break the mod for everybody else.

The first request is a lot more difficult, as this mod was designed to work with the bbcode parser, as opposed to requiring code to manhandle the "post-parsed" bbcode html code.  Let me see what I can do about fixing this up so that it works....

Quote from: RSI on April 13, 2015, 04:11:44 PM
Why wasn't this mod made to use attach=n ?
I decided to write this mod the way I did because it simply works with the bbcode parser easier.  In addition, the bbcode parser offers the ability to add more options in order to do certain things, like adjust the width, height, which side to float the image to, the margin around the image, and whether to scale the image.

EDIT:  The second reason I wrote the mod this way is that the bbcode parser cannot process the form "[attach=n]".  The ILA mod had to jump through hoops to process the bbcode, and isn't nearly as flexible as using the bbcode parser.

Quote from: RSI on April 13, 2015, 04:11:44 PM
That's going to be a big problem when people eventually upgrade to SMF 2.1 when they have 1000+ posts that already use attach=n. If this mod or a new mod is modified to work with v2.1 then what's going to happen if the mod is not using attach=n and uses attachment=n instead?
Version 2.8 Beta 1+ of this mod has been upgraded to work with SMF 2.1 Beta 1 already.  The only things not working are the UI components where the user clicks on a link to add the attachment inline to the post.

Quote from: Stanyy on April 13, 2015, 05:42:22 PM
If it was just [attachment=n], i could easily find the files handling that part and remove the 'ment' from it, but it's actually [attachment=n][/attachment] (do you notice the closing tag?). I think it's a bit too long not mentioning that some members may get confused and start putting things in-between the tags. [attach=n] is just perfect, neat and simple.
I understand.  Let me see what I can do about this particular issue....

Quote from: Stanyy on April 13, 2015, 05:42:22 PM
Also, the issue about using 0 as id of first attachment will also confuse people. It would be perfect though for computer programming forums, but not for the majority.
The reason that the first attachment is 0 is that the first attachment in the PHP array is element 0.  Like I mentioned earlier in this post, I can add an option to change this, but the default behavior is still going to be "first attachment is 0"...

Quote from: 420connect.info on April 13, 2015, 06:34:38 PM
Quote from: dougiefresh on April 12, 2015, 04:24:54 PM
Quote from: 420connect.info on April 12, 2015, 11:52:47 AM
Would it be possible / Any chance of getting the attachments to show on pages like:

index.php?action=profile;area=showposts
index.php?action=profile;area=unreadreplies
index.php?action=profile;area=unread

etc. ?


Kind Regards


I would have to look at the functions involved with those URL calls...  However, I can't fathom any reason out of the blue why it couldn't/wouldn't work....

Awesome! - Much appreciated if you'd add this in!
It's been implement in v2.8 beta 3, which is available at the mod download page.  Thank you for bringing this issue to my attention!
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on April 13, 2015, 07:45:42 PM
Would you mind sharing the edits to manually achieve this & no worries, happy to help and thank you for the mod and updates :-)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 13, 2015, 07:54:44 PM
Quote from: 420connect.info on April 13, 2015, 07:45:42 PM
Would you mind sharing the edits to manually achieve this & no worries, happy to help and thank you for the mod and updates :-)
Sure!  In Sources/Profile-View.php, find this:
Code (Find) Select
function showPosts($memID)
{
global $txt, $user_info, $scripturl, $modSettings

and add this BEFORE the semi-colon:
Code (Add After) Select
, $topic
Then find this:
Code (Find) Select
$row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);
and add this BEFORE that find:
Code (Add Before) Select
$topic = $row['id_topic'];

In Sources/Recent.php, find this:
Code (Find) Select
global $txt, $scripturl, $user_info, $context, $modSettings, $sourcedir, $board, $smcFunc
and add this BEFORE the semi-colon:
Code (Add After) Select
, $topic
Then find this:
Code (Find) Select
$row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);
and add this before the find:
Code (Add Before) Select
$topic = $row['id_topic'];

These edits place the topic number in the appropriate variable so that the parser can correctly output the relevant image request.
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on April 13, 2015, 07:59:27 PM
I'll test this out when I'm back on the computer, thanks for sharing the edits - my site has a tendency to cause problems lol
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on April 14, 2015, 07:16:18 AM
Worked like a charm!

Many thanks!  ;)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 14, 2015, 07:24:20 PM
UPDATE: Over the last day, I've been trying to see if I could get the mod to work with the "[attach=0]" form (like the ILA mod uses).  It turns out that it was easier than I expected to it to be, since all I had to do was add the closing bracket to those bbcodes in the message, then filter out the double closing brackets.... 

However, the code is still not perfect, since it's possible to add text between the brackets, aka:
[attachment=0]this file here[/attachment]
would result in a picture being shown, then right after it, you would see this:
this file here[/attachment]
So, obviously this isn't correct and I have to fix it before I can release the new version of the mod....

EDIT: This has been fixed!  Yay me!   :P

EDIT2: The text inside the first code bracket in this post would be translated using the following steps:


START: [attachment=0]This file here[/attachment]
STEP 1: [attachment=0][/attachment]
STEP 2: [attachment=0][/attachment][/attachment]
FINAL: [attachment=0][/attachment]



EDIT3: By the way, the code alterations also allow the form [attach id=0] to work correctly without the closing bracket!!!




I'm also going to make another switch to change the default behavior of the [attach] bbcode so that it can be used instead of [attachment].  Right now, [attach] will display a expandable thumbnail of the attachment instead of the attachment itself....
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 15, 2015, 04:08:28 PM
Doug,

The concern that I had is when people go to eventually upgrade to SMF v2.1 when it's released. Since that will more than likely require a clean install, but still leaving all data intact, except for all mods and hooks everyone will be looking for an alternative if the ILA mod is not updated. Those guys have moved on to other things and unless someone updates that ILA mod then what will everyone do when they have attach=n already contained within years of posts? I will be one of those people for example. I guess there might be a way to manually do a find and replace using phpMyAdimin but if you make a mistake, yikes :-\

Anyway, looks like you are working on it and glad the others finally brought it up too.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 15, 2015, 05:31:40 PM
Give me a few more days.  I've gotten the "one-based numbering" option to work (as opposed to "zero-based numbering", which is what PHP uses for the arrays when an index number isn't specified).  So the first post is referred to as attachment 1 instead of attachment 0 when the option is enabled.

However, I found a major bug in the attachment removal code, where it concerns inline attachments and the [attachment id=0] form.  Seems it won't remove/correct the attachment numbers correctly without code modification....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 17, 2015, 12:45:22 PM
UPDATE: I've got the "one-based numbering" thingy working, removed any text between the brackets for inline attachments, the new form for the inline attachments working with the bbcode parser, and all bbcode forms are correctly removed from the message post (especially when removing attachments).  This was all done without modifying posts! 

I also removed the stupid bbcode button add-on from 2.8beta2, since it doesn't make things any easier and will probably rewrite at some future date....

What remains?  Well, since Suki (http://www.simplemachines.org/community/index.php?action=profile;u=245528) was kind enough to point me in the right direction here (http://www.simplemachines.org/community/index.php?topic=535345.msg3805510#msg3805510), I'm going to try to get the SMF 2.1 editor working correctly with the inline attachments links that I'm adding to it....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 17, 2015, 12:47:33 PM
UPDATE: I've got the "one-based numbering" thingy working, removed any text between the brackets for inline attachments, the new form for the inline attachments working with the bbcode parser, and all bbcode forms are correctly removed from the message post (especially when removing attachments).  This was all done without modifying posts!  As a side note, it's amusing to me that the size of the package actually went DOWN during this rewrite!  :P

I also removed the stupid bbcode button add-on from 2.8beta2, since it doesn't make things any easier and will probably rewrite at some future date....

What remains?  Well, since Suki (http://www.simplemachines.org/community/index.php?action=profile;u=245528) was kind enough to point me in the right direction here (http://www.simplemachines.org/community/index.php?topic=535345.msg3805510#msg3805510), I'm going to try to get the SMF 2.1 editor working correctly with the inline attachments links that I'm adding to it....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 17, 2015, 10:16:18 PM
Uploaded v3.0 - April 17th, 2015
o Added msg parameter so that attachments from other posts can be included/quoted.
o Added code to allow inline attachments used in a post to be properly quoted.
o Added code to internally change the [attach=n] form to [attach=n][/attach] without modifying posts.
o Added code to remove text between brackets, aka [attach=0]This file[/attach] without modifying posts.
o Added option to use "One-based numbering" instead of "Zero-based numbering".
o Modified ID parameter so that invalid ID numbers are errored out instead of zeroed.
o Added option to make [attach=n] as same as [attachment=n] bbcodes.
o Fixed ILA_Remove_Tags function so that it removes the other 11 ILA bbcodes forms.
o Fixed ILA_Remove_Attachment function so that it removes the other 11 ILA bbcodes forms.
o Removed BBC buttton introduced in v2.8beta2 from the editor.
o Language strings are in seperate file and now loaded from Subs-InlineAttachments.php.
o Moved code responsible for setting topic ID (2.8beta3 fix) into Subs-InlineAttachments.php.

Please note that SMF 2.1 Beta 1 post UI modifications still does not work correctly yet.  It is being worked on, though....

WARNING!!!  You MUST uninstall your current version before installing this version!  There are major changes in v3.0 that will cause problems with your forum, up to and including PHP fatal errors, if you simply copy Subs-InlineAttachments.php over your existing copy!!!
Title: Re: Post and PM Inline Attachments
Post by: Stanyy on April 18, 2015, 10:19:30 AM
Quote from: dougiefresh on April 17, 2015, 10:16:18 PM
Uploaded v3.0 - April 17th, 2015
o Added msg parameter so that attachments from other posts can be included/quoted.
o Added code to allow inline attachments used in a post to be properly quoted.
o Added code to internally change the [attach=n] form to [attach=n][/attach] without modifying posts.
o Added code to remove text between brackets, aka [attach=0]This file[/attach] without modifying posts.
o Added option to use "One-based numbering" instead of "Zero-based numbering".
o Modified ID parameter so that invalid ID numbers are errored out instead of zeroed.
o Added option to make [attach=n] as same as [attachment=n] bbcodes.
o Fixed ILA_Remove_Tags function so that it removes the other 11 ILA bbcodes forms.
o Fixed ILA_Remove_Attachment function so that it removes the other 11 ILA bbcodes forms.
o Removed BBC buttton introduced in v2.8beta2 from the editor.
o Language strings are in seperate file and now loaded from Subs-InlineAttachments.php.
o Moved code responsible for setting topic ID (2.8beta3 fix) into Subs-InlineAttachments.php.

Please note that SMF 2.1 Beta 1 post UI modifications still does not work correctly yet.  It is being worked on, though....

WARNING!!!  You MUST uninstall your current version before installing this version!  There are major changes in v3.0 that will cause problems with your forum, up to and including PHP fatal errors, if you simply copy Subs-InlineAttachments.php over your existing copy!!!

You are a genius man. I will install the mod today and see how it goes. Thank you!
Title: Re: Post and PM Inline Attachments
Post by: Stanyy on April 22, 2015, 05:12:25 AM

Quote from: dougiefresh on April 17, 2015, 10:16:18 PM
o Added option to use "One-based numbering" instead of "Zero-based numbering".

Hi. When this option is selected, the bbc works ok but the link beside the first file upload field remains 0.

Another minor bug. When you preview a post with an inline attachment, it displays [invalid attachment] in the attachment's position.
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 22, 2015, 01:02:27 PM
I've had some spare time this week so I have been playing around with a live board with a clean install of SMF v2.09 and checking a few of these updated mods out.


I thought I read somewhere in one of the previous posts the issue had been addressed and corrected, but it doesn't currently seem to be working with a clean install of SMF v2.09. Was the ILA mod left installed, but just disabled when you ran your tests with this new mod or am I just mistaken and not understanding what I thought I read?
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 22, 2015, 01:40:12 PM
Oh... nevermind, my mistake...

I hadn't noticed you added the check box control setting via Modifications Settings. Last time I tried this mod none of the admin controls were there yet.

Checking that box made it work ;D
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 22, 2015, 02:43:17 PM
Ok, I had to remove and redo this last post because I spoke too soon.

So it looks like there is still an issue with the attachment numbering along with some new problem when trying to use the Highslide Image Viewer v1.7 mod. Again, I just checked all of this using a clean SMF v2.09 install.

Update: I remember why the Highslide Image Viewer v1.7 wont work, it's because it wont work with the ILA in-line attachment mod. It might be because the Highslide Image Viewer v1.7 mod itself wont work with just the [attach=n] and it requires either [attach=n][/attach] or [attachment=n][/attachment].
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 22, 2015, 05:23:37 PM
Doug, believe it or not I have one final update.

Neither of the two Highslide mods work anymore so something is definitely broke. I know the Highslide Image Viewer v1.7 mod won't work with the In-Line ILA mod, but it looks like it's more than just that now with this Post and PM In-line Attachments v3.0 mod.

Non-working mods are...

1. Highslide 4 SMF, v0.8.1

2. Highslide Image Viewer v1.7

And, the problem with the attachment numbering appears to be that it does re-number them after checking that box which fixes all of the attachments that were placed in-line using the ILA mod, but it's not re-numbering the first new attachment placed in-line with this Post and PM In-line Attachments v3.0 mod. It makes the first one [attachment=0] instead of [attachment=1] when that check box is checked so it wont display the [attachment=0] in-line.

It's funny because with the Highslide 4 SMF, v0.8.1 mod installed I tried to attach two new photos after deleting them first and it created [attachment=0] and [attachment=2] completely skipping [attachment=1]. It did that a couple of times out of about five for some strange reason which was really odd. I don't see how the Highslide 4 mod could cause that :o

Anyway, I hope all of this helps. Luckily I had some time to play around with it today.

P.S. And I did install the Highslide 4 SMF, v0.8.1 mod first before installing the Post and PM In-line Attachments mod.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 22, 2015, 06:57:11 PM
@RSI: (http://www.sherv.net/cm/emoticons/hand-gestures/doh-smiley-emoticon.gif)  Wow...  Let me look into these reports....

@Stanyy: You are right, I did miss that one....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 22, 2015, 07:12:14 PM
Quote from: Stanyy on April 22, 2015, 05:12:25 AM
Hi. When this option is selected, the bbc works ok but the link beside the first file upload field remains 0.

Another minor bug. When you preview a post with an inline attachment, it displays [invalid attachment] in the attachment's position.
Thank you for the bug report.  Yup, I missed that one.....

Quote from: RSI on April 22, 2015, 02:43:17 PM
I hadn't noticed you added the "Check if first attachment should be numbered 1?" setting via Modifications Settings. The last time I tried this mod none of the admin controls were there yet.

Checking that box does correct everything that was placed in-line using the ILA mod
Yup, added that option to make it compatible with the ILA mod, but the option is not checked by default.

Quote from: RSI on April 22, 2015, 02:43:17 PM
but now if you try to upload and place new attachments in-line using this v3.0 mod it still wants to make the first attachment [attachment=0] and not [attachment=1]. So with that box checked it wont display the [attachment=0] in-line.[/li]
[/list]
Yup, I missed that one....

Quote from: RSI on April 22, 2015, 02:43:17 PM
The Highslide Image Viewer v1.7 mod here from the SMF mod site also no longer works for some reason when the images are placed in-line. However, it works fine as soon as I take them back out of being in-line where they appear at the bottom of the post again

So it looks like there is still an issue with the attachment numbering along with some new problem when trying to use the Highslide Image Viewer v1.7 mod. Again, I just checked all of this using a clean SMF v2.09 install.
Quote from: RSI on April 22, 2015, 02:43:17 PM
Update: I remember why the Highslide Image Viewer v1.7 wont work, it's because it wont work with the ILA in-line attachment mod. It might be because the Highslide Image Viewer v1.7 mod itself wont work with just the [attach=n] and it requires either [attach=n][/attach] or [attachment=n][/attachment].
Quote from: RSI on April 22, 2015, 05:23:37 PM
Neither of the two Highslide mods work anymore so something is definitely broke. I know the Highslide Image Viewer v1.7 mod won't work with the In-Line ILA mod, but it looks like it's more than just that now with this Post and PM In-line Attachments v3.0 mod.

Non-working mods are...

1. Highslide 4 SMF, v0.8.1

2. Highslide Image Viewer v1.7
Let me investigate these bug reports....  I'm not aware of breaking compatibility with those mods....

Quote from: RSI on April 22, 2015, 05:23:37 PM
P.S. And I did install the Highslide 4 SMF, v0.8.1 mod first before installing the Post and PM In-line Attachments mod.
Good to know.  One less thing to worry/wonder about....
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 22, 2015, 09:40:54 PM
I just uninstalled the mods in the correct reverse order and then reinstalled this Post and PM In-line Attachments mod again and then the Highslide Image Viewer v1.7 mod after and I then unchecked the "Enable Highslide effects for in-line attachment?" checkbox in "Modification Settings" and hit save. I then rechecked the box and hit save again and now the Highslide Image Viewer v1.7 mod is working again.

I should have thought of that earlier today because I've seen where when installing some mods their defaults won't always get automatically selected even when the boxes are automatically checked during install and you have to go back and uncheck and then recheck the boxes so you might look at that. It's probably not always saving the correct settings in the database during install every time. I never touched that checkbox until now and it fixed it.

I haven't tried installing the Highslide 4 SMF, v0.8.1 mod again, but the only other thing is making your mod save the first attachment as [attachment=1] and not [attachment=0] anymore. That should solve the numbering issue.

P.S. Maybe make the "Enable Highslide effects for in-line attachment?" checkbox unchecked during install where people would need to go in there and check it afterwards would work?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 23, 2015, 11:28:21 AM
@RSI: I've added the forgotten template changes to the next version of the mod, and included in the package instructions a redirect to clear the file cache.  I'm still looking into the "renumbering upon deleting attachment" issue you mentioned...

Quote from: RSI on April 22, 2015, 09:40:54 PM
P.S. Maybe make the "Enable Highslide effects for in-line attachment?" checkbox unchecked during install where people would need to go in there and check it afterwards would work?
The problem I have with this is that when people have the HS4SMF or similar supported mod installed, they expect things to remain working, especially if people are upgrading from an earlier version of the mod...  It might throw people off to be forced to re-enable the mod just because....  I'm thinking that the redirect that I added SHOULD solve the settings issue you're experiencing....
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 23, 2015, 04:18:43 PM
I was able to get the Highslide Image Viewer v1.7 mod to stop working again last night by unchecking all of the check boxes and hitting save then rechecking them again and hitting save once more. When I did that the Highslide Image Viewer v1.7 mod quit working again.

I then went back and unchecked just the "Enable Highslide effects for in-line attachment?"check box and hit save then rechecked it and hit save once more and it started working again.

I then went back and tried repeating that whole step again two more times doing all of the check boxes at once and it didn't stop working again, but maybe there is some combination when checking or unchecking those check boxes that would make the Highslide Image Viewer v1.7 mod stop working again.

Something appeared to just be a little unstable. Anyway, let me know when you upload the next update and I'll try it and see what happens.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 24, 2015, 12:29:41 PM
Quote from: RSI on April 22, 2015, 05:23:37 PM
And, the problem with the attachment numbering appears to be that it does re-number them after checking that box which fixes all of the attachments that were placed in-line using the ILA mod, but it's not re-numbering the first new attachment placed in-line with this Post and PM In-line Attachments v3.0 mod. It makes the first one [attachment=0] instead of [attachment=1] when that check box is checked so it wont display the [attachment=0] in-line.
I've taken care of this particular issue.

Quote from: Stanyy on April 22, 2015, 05:12:25 AM
Another minor bug. When you preview a post with an inline attachment, it displays [invalid attachment] in the attachment's position.
Still looking for this one....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 24, 2015, 12:45:26 PM
Uploaded v3.1 - April 24th, 2015
o Viewing inline attachments now works for guests!
o Edited posts will be changed to use the new Version 3.0-style tags.
o Changed inserted inline attachment tag from [attachment=n][/attachment] to [attachment=n].
o Added some forgotten template changes to make the One-based numbering option work correctly.
o Fixed a bug so that quotes without message ID no longer remove inline attachments with message ID specifed.
o Fixed bug so that floating inline attachment had a download link & counter beneath it when option is set.
o Fixed a few undefined errors within Subs-InlineAttachments.php.
o Fixed multiple bugs in ILA_Fix_Tags function.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 24, 2015, 07:00:29 PM
Uploaded v3.1 - April 24th, 2015
o Fixed a bug preventing previewing posts from working correctly.
o Viewing inline attachments now works for guests when viewing PM attachments permission is granted.
o Edited posts will be changed to use the new Version 3.0-style tags.
o Changed inserted inline attachment tag from [attachment=n][/attachment] to [attachment=n].
o Added some forgotten template changes to make the One-based numbering option work correctly.
o Fixed a bug so that quotes without message ID no longer remove inline attachments with message ID specifed.
o Fixed bug so that floating inline attachment had a download link & counter beneath it when option is set.
o Fixed a few undefined errors within Subs-InlineAttachments.php.
o Fixed multiple bugs in ILA_Fix_Tags function.
o Fixed undefined element error within Sources/Display.php.
o ILA settings moved into a seperate area under Modification Settings, includes online version check.
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 24, 2015, 10:06:23 PM
It looks like everything else is working now, but the download links and counter have disappeared from under the inline attachments for some reason.

I went into Modification Settings and unchecked and then rechecked "Show download link and counter under inline attachment?" but it's still not displaying them under the inline photos anymore. It was working in v3.0 and before, but now it's not anymore with v3.1

I'm using the Highslide Image Viewer v1.7 mod.
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 25, 2015, 10:44:42 AM
I double checked this again this morning by uninstalling everything and then reinstalling v3.1 without any Highslide mods and it's still not showing the download links and counter under the photos I placed in-line. Unchecking and then rechecking the "Show download link and counter under inline attachment?" checkbox doesn't do anything.

I see in your release notes where you said you fixed something with that, but it always worked for me before and I never had any problems with it until now. It looks like everything else is fixed now though.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 25, 2015, 01:34:04 PM
Uploaded v3.1.1 - April 25th, 2015
o Added code to cache the mod version check for 1 day between checks.
o Fixed code regarding times download and download link without float/margin parameter.
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 25, 2015, 03:28:25 PM
You almost got it. The download links and counts are back, but it's displaying the attachments twice now.

Attached below is a screen shot of what I'm getting. I have one attachment placed inline, but it's showing it twice with only one link and count at the bottom of the duplicate.

P.S. I think the one on top is the one that needs to be removed.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 25, 2015, 04:26:23 PM
@RSI: Sorry about that!  Please redownload the version 3.1.1 of this mod.  I've fixed a small typo in the Subs-InlineAttachments.php file that added more stuff to the variable that necessary....  Thanks for the bug report!
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 25, 2015, 05:23:30 PM
No problem, I'm just trying to help you get this mod working.

You just fixed the duplicate problem and it works now, and... I really hate to tell you this..., but if you go to create a new post it wants to insert it as [attachment=0] instead of [attachment=1] with the checkbox checked in Mod Settings / ILA /

I don't know if I just didn't notice it before or if it's something new because of what you just changed, but here's what happens. If you attach a photo to a new post and place it in-line and hit save it will save it as [attachment=0] which won't display it in-line with the checkbox checked. It even says (Insert Attachment 0) before you do it. However, if you attach a photo, but don't place it in-line first and save it you can go back and modify the post after and insert it in-line as [attachment=1] and it says (Insert Attachment 1) then.

Sorry to give you bad news AGAIN, but that's what it's doing now.
Title: Re: Post and PM Inline Attachments
Post by: Stanyy on April 25, 2015, 06:16:04 PM
Quote from: Stanyy on April 22, 2015, 05:12:25 AM

Hi. When this option is selected, the bbc works ok but the link beside the first file upload field remains (insert attachment 0).

Yeah, this bug is still present.
Awesome mod btw.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 25, 2015, 07:10:12 PM
Man, I just can't seem to get this right....  I made the proper changes to the templates so that the "one-based numbering" option would work correctly for the new first attachment.  Please redownload the v3.1.1 copy of the mod.  Thanks for the bug report!

@RSI: No worries about the bug reports!  Thank you for reporting them.  Sometimes it amazes me that mods (both mine and others) go days or months without reporting issues when there clearly is an issue...  While it "annoys" me to fix them, I'd rather fix the bugs than not realize that there is a problem (primarily because it may be a while before I come back to this mod)...  :P

@Stanyy: Thanks for the bug confirmation, as well as the compliment!
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 25, 2015, 08:31:26 PM
Quote from: dougiefresh on April 25, 2015, 07:10:12 PM
Please redownload the v3.1.1 copy of the mod.  Thanks for the bug report!

That seems to work now. Let me play with it over the rest of the weekend and see if anything else pops up or in the error log and I will let you know.

Thanks...
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 26, 2015, 10:27:51 AM
Ok, everything seems to be working, but I was playing around by moving, deleting and re-saving attachments in a few posts and the errors popped up in the log below. It seems to be the same 3 errors each time it happens. I got the same thing to happen last night.

P.S. I also have the Highslide Image Viewer v1.7 mod installed.

URL: http://mydomain.com/index.php?action=admin;area=modsettings;sa=ilaApply
Undefined variable: scripturlApply
File: /home/me/public_html/Sources/Subs-InlineAttachments.php
Line: 653

URL: http://mydomain.com/index.php?action=admin;area=modsettings;sa=ila;saveApply
Undefined variable: scripturlApply
File: /home/me/public_html/Sources/Subs-InlineAttachments.php
Line: 653

URL: http://mydomain.com/index.php?action=admin;area=modsettings;sa=ila;d8c19a0192d=294651ed01b391e8eadd83f0dc1fb9d4Apply
Undefined variable: scripturlApply
File: /home/me/public_html/Sources/Subs-InlineAttachments.php
Line: 653
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 27, 2015, 03:58:48 PM
Did you get the chance to look at the Undefined variable: scripturlApply error yet?

I was going to update my board to 2.0.10 and install this Post and PM Inline Attachments mod instead of the old ILA mod, but I don't want to do it yet until the error has been addressed.

Thanks...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 27, 2015, 06:42:26 PM
Uploaded v3.1.2 - April 27th, 2015
o Fixed missing variable declaration on ILA settings page.

@RSI:  I meant to post it yesterday, as I fixed the error very quickly....
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 27, 2015, 09:37:22 PM
Interesting...  I updated my test board to SMF v2.0.10 and I held off reporting this because I wanted to make sure what I was seeing was real and it looks like it is, but I don't think it's happening because of the v2.09 to v2.0.10 update.

The [attach=n] inline pics won't expand when I click on them, but the [attachment=n] pics will. Even installing the Highslide Image Viewer v1.7 now doesn't make any difference. It works on the [attachment=n] pics, but it won't on the [attach=n] pics.

Could there be any connection with what you just changed?
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 28, 2015, 11:22:41 AM
I just went though and deleted my test board including it's database and then started over and installed a fresh copy of SMF v2.010 and now the problem appears to be gone. I did re-download this mod again so I'm not sure if you updated the file again after I posted last night or if my clean install fixed it, but everything appears to be good now 8)

Hopefully everything will work when I upgrade my board today, fingers crossed...

Thanks for all of the hard work.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 28, 2015, 02:47:27 PM
Well, I don't know what to say about this issue.  Nothing in Subs-InlineAttachments.php changed that would prevent the "attach" tag from expanding using highslide stuff, and I don't see anything that would prevent it from doing so...  I'm glad that your test board works now, but it still leaves the question of "WTF happened" in the air.

Upon examining the Subs-InlineAttachments.php file, I did notice a potential problem with the source file, specifically when you are referring to an attachment in another post, and quoting from another post isn't allowed.  I'll probably release another version later today, after looking for anything else that might have caused the issue you raised.  (And no, I didn't reupload v3.1.2....)

EDIT: It'll be an update that you can just replace the Subs-InlineAttachments.php file....
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 28, 2015, 03:49:10 PM
Quote from: dougiefresh on April 28, 2015, 02:47:27 PM
EDIT: It'll be an update that you can just replace the Subs-InlineAttachments.php file....

That's good, because I already upgraded my board this morning. Only took be about 30 minutes to upgrade it and reinstall all of the mods again, but at least the old ILA mod and it's companion Highslide 4 SMF mod are gone now. That particular Highslide mod doesn't fully work right anymore.

Anyway, the in-line pics are expanding correctly now, but I will try the new Subs-InlineAttachments.php file when you upload it. That will probably be the last thing I do to it until SMF v2.1 is released. As long as nothing generates any errors and works correctly till then I'm happy :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 29, 2015, 04:37:10 PM
I don't see anything preventing the "attach" tag from expanding.  The only possibility that I can think of is when the attached image size is less than the maximum thumbnail size, in which case the forum doesn't create a thumbnail.  That being said, it still should do the expanding thingy with the highslide mods....

An updated Subs-InlineAttachments.php is attached.  Just replace your forum's copy with this one and that error should go away....
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 29, 2015, 04:54:02 PM
Quote from: dougiefresh on April 29, 2015, 04:37:10 PM
An updated Subs-InlineAttachments.php is attached.  Just replace your forum's copy with this one and that error should go away....

Woooow, I'm getting many Undefined variable: use_thumbnail errors with that new file.

It's coming from line 531 and 532. I'm putting the old one back for now.
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 29, 2015, 05:11:01 PM
Dude... I re-uploaded the Subs-InlineAttachments.php to try and undo it and guess what? The attach=n pics wont expand. Just uploading that new Subs-InlineAttachments.php file and trying to use it then putting the one before it back again caused the problem. It must somehow be changing some other settings.

Now I have to figure out how to undo the problem... :-X :-X :-X :-X :-X
Title: Re: Post and PM Inline Attachments
Post by: Motorhed on April 29, 2015, 06:48:45 PM
RETRACTED COMPLAINT. Turning on "make sure attachment is 1" thing in settings fixes this!

This just flat-out doesn't work for me.

Installed fine, but every file I attach gives the "Invalid" text in the post no matter what I do.

:(

On preview, it works. After posting the edit, it doesn't.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 29, 2015, 06:56:05 PM
Quote from: RSI on April 29, 2015, 04:54:02 PM
Woooow, I'm getting many Undefined variable: use_thumbnail errors with that new file.

It's coming from line 531 and 532. I'm putting the old one back for now.
OMG!  I need to smack my self on the forehead and state I should have had a V8 (https://www.youtube.com/watch?v=KMP3_zuT8lc)....  I moved two lines that refer to the variable before the variable declaration!  DOH!!

Quote from: RSI on April 29, 2015, 05:11:01 PM
Dude... I re-uploaded the Subs-InlineAttachments.php to try and undo it and guess what? The attach=n pics wont expand. Just uploading that new Subs-InlineAttachments.php file and trying to use it then putting the one before it back again caused the problem. It must somehow be changing some other settings.

Now I have to figure out how to undo the problem... :-X :-X :-X :-X :-X
I've never had such a weird problem....  The new file doesn't change any settings, nor should uploading the old file have any effect on the settings used....  I'm really confused....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 29, 2015, 06:57:50 PM
Quote from: Motorhed on April 29, 2015, 06:48:45 PM
This just flat-out doesn't work for me.

Installed fine, but every file I attach gives the "Invalid" text in the post no matter what I do.

:(

On preview, it works. After posting the edit, it doesn't.
WTF!!  Have you tried uninstalling the mod completely from your forum yet?  Might wanna try reinstalling once you uninstall the mod....  This makes absolutely no sense to me....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 29, 2015, 07:05:26 PM
Quote from: Motorhed on April 29, 2015, 06:48:45 PM
RETRACTED COMPLAINT. Turning on "make sure attachment is 1" thing in settings fixes this!
Wow!  Good to know what was causing the issue!  Thanks for the feedback....

Attached is an updated version of the previously attached file that corrects the undefined variable errors you reported....  Use it if you want...

EDIT:  VERY IMPORTANT: Remember, if the "first attachment is number 1" option is set, the minimum value for attachment ID is ONE (1).  Numbers below that will error out.  When it is unchecked, the minimum value for attachment ID is ZERO (0).
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 29, 2015, 08:37:32 PM
Don't let it get you down ;)

I already fixed it and here is what happened. I renamed my Subs-InlineAttachments.php file that was working to Subs-InlineAttachments_(Working).php Then I overwrote the one on my server with the one you uploaded earlier today. I then went to a few posts and clicked on [attach=n] and [attachment=n] pics and everything was working, but when I checked the log I saw all of the Undefined variable: use_thumbnail errors. So, I then I reported it and re-uploaded the working file from before. After doing that the [attach=n] pics would no longer expand like what I saw on my test board the other day.

Now, I went through and removed all hooks and ran the SMF v2.010 upgrade package again on my board and re-installed this Post and PM Inline Attachments v3.1.2 mod with the known working Subs-InlineAttachments file. However, the [attach=n] pics would still not expand.

Here's what I had to do to get it working again, I manually went into my database into the smf_settings table and selected and dropped everything that said ila It's looks like there was also stuff there from the old ILA mod too (spuds mod). That's one of the problems when you uninstall 90% of these mods because it normally doesn't remove all of the tables and entries it created during install.

Anyway, after manually dropping all of that leftover junk I performed the SMF v.2.0.10 upgrade again to make sure and re-installed the Post and PM Inline Attachments v3.1.2 and now the [attach=n] pics are expanding again.

There must be some conflict with either the old leftover ILA mod table entries or with the ones your mod is creating. On my test board I had installed and uninstalled the old ILA mod and your mod several times. Now it happened on my actual live board today just by uploading the new Subs-InlineAttachments.php file then overwriting it with the old one that was working.

Update: The more I think about it the more I think it is the leftover tables from the old ILA mod (spuds mod). That might explain why the problem went away when I deleted my test board's database and then re-created it. It might also explain why I was having the weird problem with the Highslide on and off checkbox that you eventually removed. Depending on where people leave those checkboxes set when they uninstall the old ILA mod might determine the settings when they install your mod. As a matter of fact I think I do remember unchecking the checkbox to turn that mod off before I uninstalled it. That might actually explain why when I installed your mod last week the Highslide wouldn't work until I played around with the checkbox that was automatically checked during install.

You might need to make it search for the old ILA mod table entries and delete them first before it installs.
.
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 29, 2015, 09:27:29 PM
Quote from: RSI on April 29, 2015, 08:37:32 PM
Don't let it get you down ;)

I already fixed it and here is what happened. I renamed my Subs-InlineAttachments.php file that was working to Subs-InlineAttachments_(Working).php Then I overwrote the one on my server with the one you uploaded earlier today. I then went to a few posts and clicked on [attach=n] and [attachment=n] pics and everything was working, but when I checked the log I saw all of the Undefined variable: use_thumbnail errors. So, I then I reported it and re-uploaded the working file from before. After doing that the [attach=n] pics would no longer expand like what I saw on my test board the other day.

Now, I went through and removed all hooks and ran the SMF v2.010 upgrade package again on my board and re-installed this Post and PM Inline Attachments v3.1.2 mod with the known working Subs-InlineAttachments file. However, the [attach=n] pics would still not expand.

Here's what I had to do to get it working again, I manually went into my database into the smf_settings table and selected and dropped everything that said ila It's looks like there was also stuff there from the old ILA mod too (spuds mod). That's one of the problems when you uninstall 90% of these mods because it normally doesn't remove all of the tables and entries it created during install.

Anyway, after manually dropping all of that leftover junk I performed the SMF v.2.0.10 upgrade again to make sure and re-installed the Post and PM Inline Attachments v3.1.2 and now the [attach=n] pics are expanding again.

There must be some conflict with either the old leftover ILA mod table entries or with the ones your mod is creating. On my test board I had installed and uninstalled the old ILA mod and your mod several times. Now it happened on my actual live board today just by uploading the new Subs-InlineAttachments.php file then overwriting it with the old one that was working.

Update: The more I think about it the more I think it is the leftover tables from the old ILA mod (spuds mod). That might explain why the problem went away when I deleted my test board's database and then re-created it. It might also explain why I was having the weird problem with the Highslide on and off checkbox that you eventually removed. Depending on where people leave those checkboxes set when they uninstall the old ILA mod might determine the settings when they install your mod. As a matter of fact I think I do remember unchecking the checkbox to turn that mod off before I uninstalled it. That might actually explain why when I installed your mod last week the Highslide wouldn't work until I played around with that checkbox that was checked during install.

You might need to make it search for the old ILA mod table entries and delete them first before it installs.
.
Title: Re: Post and PM Inline Attachments
Post by: RSI on April 30, 2015, 02:17:56 PM
When I have the chance this coming weekend I'll install another test board and play around again and see if I can help you figure out what's going on for certain. I don't want to take the risk of having to redo my board again. Twice is enough. I'm using the Remove images from quotes v1.6 mod so I have the quotes feature disabled. I don't really need or care if that works on my board anyway.

I'm not sure what timezone you are on, but I'm an engineer here in Silicon Valley California. I have a hunch it's one or more of the old ILA mod tables causing a conflict and things (or something) is working against each other in the smf_settings table
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 01, 2015, 08:54:30 PM
YET ANOTHER UPDATE: For the next version, I've changed the mod settings php file so that the settings are set to mod defaults, regardless of previous settings.  I've also gotten the "Insert Attachment" thingy to work on SMF 2.1, but haven't figured out SMF 2.0 with the SCEditor mod installed yet (still working on this one, though...)




@RSI:  I looked at both Highslide mods, and they don't share any settings.  So there is absolutely no possibility that a SETTING can be causing the conflict (at least, as far as I can tell).  It's possible that it could be a conflict in the code, but once again, I can't imagine how it would conflict.

Quote from: RSI on April 30, 2015, 02:17:56 PM
I'm not sure what timezone you are on, but I'm an engineer here in Silicon Valley California.
I am a automotive railcars loader in Tennesse.  I do programming as a hobby....
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 01, 2015, 10:05:02 PM
Quote from: dougiefresh on May 01, 2015, 08:54:30 PM
@RSI:  I looked at both Highslide mods, and they don't share any settings.  So there is absolutely no possibility that a SETTING can be causing the conflict (at least, as far as I can tell).  It's possible that it could be a conflict in the code, but once again, I can't imagine how it would conflict.

Actually, I was talking about the old ILA In-Line attachment mod and not the ILA Highslide mod. The old ILA In-Line attachment mod settings are still left in the smf_settings table after you uninstall it. That's what got me to thinking and thought it was worth looking into because it sort of made a little sense. It still could be just something weird in the Subs-InlineAttachments.php file code, but whatever it is it was defiantly real because it happened again on my actual board and not just on my test board. It happened both times even after uninstalling the Highslide mod.

Hope that helps...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 02, 2015, 08:06:48 AM
UPDATE: Mod now works with SMF 2.0 with SCEditor mod installed!  Yay!  One clearly definable problem remains: Previewing posts with inline attachments doesn't work for that message, but works for quoted images....  Still looking into the issue that RSI brought up...




@RSI: I'm sorry.  I kinda misspoke.  I meant to say that I also looked at Spud's SMF-ILA (https://github.com/Spuds/SMF-ILA) mod, which doesn't share any settings with this mod, either.  This is the mod you are talking about, right?
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 02, 2015, 10:29:10 AM
Hello Dougie,

First of all let me commend you, this mod is exactly what I'm looking for and thus far it has worked almost perfectly with 2.0.10 and highSlide. Images are the most important thing to me - I have a macro photography site and people ask me all sorts of questions using the form, so adding a forum makes sense. And because it will be primarily photography orientated, I have to have the best options with images that there are - these guys like posting photos :)

May I ask you a couple of questions. Does adding this resize images in some way even if you have maximum image width and height set to 10,000px in the admin option? The reason I ask is because I want to show EXIF for every image posted and I already fixed fatman's exif mod (http://custom.simplemachines.org/mods/index.php?mod=169) to make it work and work better on 2.0.10. If you look at http://extreme-macro.co.uk/forums/index.php?topic=10.0 you'll see it does fine with image as thumb and shows the stuff but I'd like the same with inline images. I'm not sure how to do it but it didn't by default on that thread so either it's been stripped or it's not being inserted. before I look to fix the latter can I just confirm it's not the former please?

Great work, thanks again,

-Johan
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 02, 2015, 10:33:38 AM
Quote from: dougiefresh on May 02, 2015, 08:06:48 AM
@RSI: I'm sorry.  I kinda misspoke.  I meant to say that I also looked at Spud's SMF-ILA (https://github.com/Spuds/SMF-ILA) mod, which doesn't share any settings with this mod, either.  This is the mod you are talking about, right?

Yeah, that's the one. Then it must have been something with your settings in the smf_settings table. The only way I could get the problem to go away was select everything that said ILA and drop them then reinstall the mod. It was still weird though that just trying that other Subs-InlineAttachments.php file that produced those errors in the log  and then putting the one back before it made it happen again. I'm trying to remember if I changed the settings under Modifications => Settings => ILA after uploading the new file before putting the other one back, I may have.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 02, 2015, 10:41:12 AM
Uploaded v3.2 - April 29th, 2015
o Modified inserting attachment javascript code so that it works with SMF 2.1 Beta 1....
o Modified inserting attachment javascript code so that it works with SMF 2.0 with SCEditor mod installed.
o Fixed bug relating to referring to inline attachments from another message.
o All settings reset to their default settings upon installation or upgrade.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 02, 2015, 01:39:36 PM
Quote from: roshaoar on May 02, 2015, 10:29:10 AM
May I ask you a couple of questions. Does adding this resize images in some way even if you have maximum image width and height set to 10,000px in the admin option? The reason I ask is because I want to show EXIF for every image posted and I already fixed fatman's exif mod (http://custom.simplemachines.org/mods/index.php?mod=169) to make it work and work better on 2.0.10. If you look at http://extreme-macro.co.uk/forums/index.php?topic=10.0 you'll see it does fine with image as thumb and shows the stuff but I'd like the same with inline images. I'm not sure how to do it but it didn't by default on that thread so either it's been stripped or it's not being inserted. before I look to fix the latter can I just confirm it's not the former please?
This makes NO changes to the attachment handling code, and a few minor changes to the attachment display code so that the bbcode parser can get the attachments in the parse_bbc function.  However, the default setting for this mod is to hide the images used inline from being displayed again as an attachment thumbnail.  Unchecking this box will enable the EXIF information to be displayed by Display.template.php without further modification, but I have a feeling that's not what you're wanting (or asking for).

I'll add some code to the next version so that the EXIF information to the Subs-InlineAttachments.php file so that it is displayed along with the inline attachment, just like it would be if it was shown as an attachment (but not shown inline).
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 02, 2015, 02:06:32 PM
Uploaded v3.3 - May 2nd, 2015
o Added checkbox to enable the display of EXIF information (when available) to ILA settings.
o Modified Subs-InlineAttachments.php to display EXIF information when option is enabled.
o Modified code to optimize memory usage within Sources/Display.php.
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 02, 2015, 06:00:44 PM
Wow. You are truly phenomenal. I'd buy you a beer if you were near!!!

I've installed the update and tested it out at the same thread but sadly no exif showing :(. Probably because the checkbox wasn't there to tick - screenshot attached. I take it this where the checkbox should be?

[post edit - yes that's it. When I edited the file to read "if (empty($modSettings['ila_display_exif']) && etc" it shows exif! Wow!!]
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 02, 2015, 06:23:04 PM
The mod checks for the presence of the Sources/exif.php before showing that option.  Do you have that file?
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 02, 2015, 06:25:34 PM
Yeah I do - it's something to do with the check. When I edit the file to read "if (empty($modSettings['ila_display_exif']) && isset($attachment['exif']))" it works fine
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 02, 2015, 06:49:20 PM
Uploaded v3.3.1 - May 2nd, 2015
o Fixed code that shows the Highslide and EXIF option in the ILA settings.

@roshaoar: Damn, I'm sorry I completely missed that one!  With this update, both the Highslide and EXIF options should be visible on the ILA settings page now.  Seems that I messed up on adding the options to the $config array instead of the $config_vars array....  DOH!
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 02, 2015, 06:53:26 PM
Hehe, you're a star for doing it in the first place, let me upload it and check it out :)
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 02, 2015, 07:00:53 PM
That is really really really cool, thank you so much. In time, thousands of wannabe macro gods will learn thank to you :) I think you've added something to make the font size bigger, and it looks like there's a missing br that needs to be dealt with to make the two versions compatible. But that's just incidental - this is fabulous. I can't thank you enough :)

[update - font size thing is only if "Show download link and counter under inline attachment?" unchecked - style must in that things' class]
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 02, 2015, 07:33:57 PM
@roshaoar: Find this line in Sources/Subs-InlineAttachments.php:
Code (Find) Select
$html .= $attachment['exif'] . '<br /><br />';
and replace it with this:
Code (Replace) Select
$html .= '<br /><span class="smalltext">' . $attachment['exif'] . '</span><br /><br />';
Does this make it look proper?  Thanks in advance!
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 02, 2015, 08:42:57 PM
That wasn't the only problem, it'a not creating any backup in the Packages/backups folder so there in no uninstall feature. You can't uninstall it once you install it. [Uninstall] isn't there anymore and it also stills says 3.2 and not 3.3
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 02, 2015, 09:03:54 PM
That works pretty good now ;) At first I thought there was a new problem, but then I realized it was me :-X

Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 03, 2015, 04:56:53 AM
Quote from: dougiefresh on May 02, 2015, 07:33:57 PM
Does this make it look proper?  Thanks in advance!
Hmmmm, not really -  The parent div already has class smallclass so added to a span as well makes it doubly small :). Just need to make it consistent with the highslide-heading class that highslide throws the thumbnail and text into.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 03, 2015, 09:05:24 AM
Okay, keeping that last mod to Sources/Subs-InlineAttachments.php, find this line:
Code (Find) Select
$html = '<div class="smalltext"' . $divfloat . '>' . $html . '<br/><a href="' . $image . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ('. $attachment['size']. ($attachment['is_image'] ? '. ' . $src_width . 'x' . $src_height . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)</div>';
and replace it with this line:
Code (Replace) Select
$html = '<div' . $divfloat . '>' . $html . '<br/><span class="smalltext"><a href="' . $image . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ('. $attachment['size']. ($attachment['is_image'] ? '. ' . $src_width . 'x' . $src_height . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)</span></div>';
This should solve the text-size problem....
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 03, 2015, 09:31:31 AM
Thanks Dougie! It's very very very close - if you look at http://extreme-macro.co.uk/forums/index.php?topic=10.0 the only remaining difference for me (ie10) seems to be the spacing between brand, camera and orientation. There seems to be some added space there that's not in the one above. I havn't looked into it yet whether it's browser or something else.
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 03, 2015, 01:31:26 PM
fyi I'm starting to wonder if I have something else different to you, different highslide or something else. For example my source isn't getting overflow:none over the div, nor is it getting the title in the alt. Anyhow I've put tests in my source for now and if I discover what's going on - ie what the difference is/was - I'll come back to it and post a follow up...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 03, 2015, 01:42:03 PM
Quote from: roshaoar on May 03, 2015, 09:31:31 AM
Thanks Dougie! It's very very very close - if you look at http://extreme-macro.co.uk/forums/index.php?topic=10.0 the only remaining difference for me (ie10) seems to be the spacing between brand, camera and orientation. There seems to be some added space there that's not in the one above. I havn't looked into it yet whether it's browser or something else.
Please attach your Sources/Display.php and Themes/default/Display.template.php so I can see what is happening in your files....

What Highslide mod are you using?  Maybe I can build in better support for it....
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 03, 2015, 02:28:49 PM
Highslide is Highslide Viewer 1.7 (http://custom.simplemachines.org/mods/index.php?mod=1450) from here. Have attached files, but latest observation is that it's more something to do with the html that's being returned. Subs-InlineAttachments.php has &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in our problem area, whereas the other has blank spaces and one &nbsp;. So the other's blank spaces don't get seen as spaces in the html and there's just one &nbsp;. Does that ring any bells? The style is actually perfectly fine, the problem is the blasted spaces :)



Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 03, 2015, 02:30:25 PM
Uploaded v3.3.2 - May 3rd, 2015
o Minor font size adjustment to the code displaying the EXIF information.

@roshaoar: Unfortunately, I posted the newest version, then saw your post.  I think that's something to do with the parser converting spaces to &nbsp;, not my mod.  So I guess the solution would be to remove the extra spaces....
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 03, 2015, 02:53:20 PM
Epic. The solution was in exif.php: I added:

case "Make":
  $val= str_replace(' ', '', $val);
  break;
case "Model":
  $val= str_replace('  ', '', $val);
  break;
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 04, 2015, 10:55:03 AM
Not to throw another wrench into the system, but how hard would it be to add an update feature in between (Insert Attachment 1) and (Clear Attachment) ?

In other words,  (Insert Attachment 1) (Update) (Clear Attachment)

Not sure if the Attachment number would throw it off, but one of the other great mods to another BB forum software was an update button that would just overwrite the same attachment in a post if it had the same file name to where it wouldn't change the counts, etc.

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 04, 2015, 03:13:55 PM
Quote from: RSI on May 04, 2015, 10:55:03 AM
Not to throw another wrench into the system, but how hard would it be to add an update feature in between (Insert Attachment 1) and (Clear Attachment) ?

In other words,  (Insert Attachment 1) (Update) (Clear Attachment)

Not sure if the Attachment number would throw it off, but one of the other great mods to another BB forum software was an update button that would just overwrite the same attachment in a post if it had the same file name to where it wouldn't change the counts, etc.
So if you had two attachments in a post, both named "Blah.png", and the first one was an inline attachment (let's say attachment # 1), then pressing Update on the second copy of "Blah.png" (let's say attachment # 2) would change the [attach=1] to [attach=2], correct?
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 04, 2015, 03:29:59 PM
Quote from: dougiefresh on May 04, 2015, 03:13:55 PM
So if you had two attachments in a post, both named "Blah.png", and the first one was an inline attachment (let's say attachment # 1), then pressing Update on the second copy of "Blah.png" (let's say attachment # 2) would change the [attach=1] to [attach=2], correct?

However it could be made to work. The other BB SW mod would just overwrite the old attachment and it would still be attached with the same attachment number as before. In other words you would update [attachment=1] and it would still be [attachment=1] after updating it and the views count would remain the same with no change.

Granted, in this situation it may require something completely different using a different approach all together, but I wouldn't do anything that might screw the current mod up because it appears to be working really good now. It would just be really cool if it also had the update (or edit) feature built-in to it.

Also, instead of using (Insert Attachment 1) (Update) (Clear Attachment), using (Insert Attachment 1) (Clear Attachment) (Update) or (Edit) might be a better arrangement.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 04, 2015, 03:36:43 PM
Quote from: RSI on May 04, 2015, 03:29:59 PM
However it could be made to work. The other BB SW mod would just overwrite the old attachment and it would still be attached with the same attachment number as before. In other words you would update [attachment=1] and it would still be [attachment=1] after updating it and the views count would remain the same with no change.

Granted, in this situation it may require something completely different using a different approach all together, but I wouldn't do anything that might screw the current mod up because it appears to be working really good now. It would just be really cool if it also had the update (or edit) feature built-in to it.

Also, instead of using (Insert Attachment 1) (Update) (Clear Attachment), using (Insert Attachment 1) (Clear Attachment) (Update) or (Edit) might be a better arrangement.
While I think that it's an interesting idea for attachment management, I don't feel that it falls within the scope of this mod, as it would require what would probably be MAJOR changes to the attachment handling code....  The goal of this mod is to simply put the image attachments inline with the post/PM....
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 04, 2015, 03:45:28 PM
Quote from: dougiefresh on May 04, 2015, 03:36:43 PM
While I think that it's an interesting idea for attachment management, I don't feel that it falls within the scope of this mod, as it would require what would probably be MAJOR changes to the attachment handling code....  The goal of this mod is to simply put the image attachments inline with the post/PM....

Yeah, maybe a future and separate Attachment Update or Attachment Edit mod.

Anyway, thanks again for all your hard work on this.
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 13, 2015, 04:20:43 AM
Just a fyi, but this mod 3.3.2 seems to break Recent Forum Topics Boardindex 1.0 (http://custom.simplemachines.org/mods/index.php?mod=3856) fairly spectacularly. My comments starting here (http://www.simplemachines.org/community/index.php?topic=522114.msg3811223#msg3811223) are all due to a conflict between these two. Pipke and I couldn't work out what the problem was so I started afresh and with this mod added, that one breaks. I have a testboard set up for this conflict - pipke has access, let me know if you want access too so you guys can iron out the problem between you there.
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 13, 2015, 07:03:39 AM
Fyi - dem at http://extreme-macro.co.uk/boards/. Dougie I made you a login, see your PMs.

-Johan
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 13, 2015, 05:10:43 PM
I read the other thread, starting where you pointed me to.  Let me see what I figure out....
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 13, 2015, 05:13:48 PM
Thanks Dougie. If there's anything I can do let me know. I'm out of my depth here though.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 13, 2015, 06:48:27 PM
@roshaoar: I installed both mods on a clean forum.  I commented out the line from Subs-InlineAttachments.php that sets the topic ID variable (line 137), cleared the error log, then refreshed the board index.  The Recent Forum Topics BoardIndex mod seems to function normally with that particular line commented out.... 

Can you confirm that commenting that line is the (temporary) solution?  Thanks!
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 14, 2015, 02:02:18 AM
Yep, superb, that does it. Thanks!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 14, 2015, 08:53:17 AM
Quote from: roshaoar on May 14, 2015, 02:02:18 AM
Yep, superb, that does it. Thanks!
Good.  I can focus on writing the permanent solution for this problem now....
Title: Re: Post and PM Inline Attachments
Post by: josx2 on May 14, 2015, 10:49:22 AM
I first wanna say this is such a great mod!  Thx so much for putting it together :)

I just updated to the latest version & think I may have found 2 bugs.   I have a 3 file attachment limit in my forum (restricted to .jpg only).  I also have the checkbox set for first attachment starting at 1:

Bug 1)   When I add 1, 2, or 3 images to a post at one time, no problem.  But, when I add 1 image, and modify that post to add image #2 & #3, #3's "insert Attachment 3" link doesn't function (2 works fine).  If I have 2 images in a post and modify it to add #3 image, same problem..."insert attachment 3" link doesn't work.  But I can manually type [attachment=3] into the post body to have it show inline.

Bug 2) the "Allow quoted attachment images from another post?" option appears not to work.  When I quote a post with attached images, the text box shows "[attachment=1]" while creating the post.  And when the post is submitted, the quote box for the quoted post says "[Invalid Attachment]"
Title: Re: Post and PM Inline Attachments
Post by: josx2 on May 14, 2015, 02:05:29 PM
disregard bug #1...dunno what happened, but now it appears to be working fine when modifying a post & adding the additional pics to put 3 images into it
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 14, 2015, 07:57:20 PM
@roshaoar:  I've got a solution built for this issue.  Trying to diagnose bug report by josx2 before releasing new version....

@josx2:  Bug #2 is interesting.  I can reproduce this issue....  I'll still look into bug report #1....
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 14, 2015, 08:03:15 PM
Doug,

Bug 2 does look real. I have the Remove images from quotes v1.6 mod installed on my board because I don't want images to appear in any of the quotes and that mod removes them. However, for some reason this mod is adding the line [Invalid Attachment] when someone quotes a post with inline attachments.

I just never noticed it before...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 15, 2015, 09:38:23 AM
Uploaded v3.4 - April 14th, 2015
o Fixed topic display issue when using Recent Forum Topics Boardindex (http://custom.simplemachines.org/mods/index.php?mod=3856) mod.
o Fixed inline attachment display issue when quoting inline attachments from another post.
o Fixed issue with quoting inline attachments that changed the bbcode to an unusable bbcode.
o Added check to make sure image attachment has been approved before displaying it.

Quote from: josx2 on May 14, 2015, 10:49:22 AM
Bug 1)   When I add 1, 2, or 3 images to a post at one time, no problem.  But, when I add 1 image, and modify that post to add image #2 & #3, #3's "insert Attachment 3" link doesn't function (2 works fine).  If I have 2 images in a post and modify it to add #3 image, same problem..."insert attachment 3" link doesn't work.  But I can manually type [attachment=3] into the post body to have it show inline.
I couldn't reproduce this bug.
Title: Re: Post and PM Inline Attachments
Post by: roshaoar on May 15, 2015, 09:43:42 AM
Fab, you're a gent. I'll install this over the w/e

Thanks again

-Johan
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 15, 2015, 12:01:03 PM
Quote from: dougiefresh on May 15, 2015, 09:38:23 AM
Uploaded v3.4 - April 14th, 2015

That is now generating an error every time you view a page with inline attachments. I'm getting the error below in the log.

URL: http://mydomain.com/index.php?topic=466.75
File: /home/me/public_html/Themes/default/Display.template.php
Line: 499
Title: Re: Post and PM Inline Attachments
Post by: josx2 on May 15, 2015, 12:22:01 PM
Updated to ver 3.4 & quoted pics now work :)  Thx!
Quote from: dougiefresh on May 15, 2015, 09:38:23 AM
Quote from: josx2 on May 14, 2015, 10:49:22 AM
Bug 1)   When I add 1, 2, or 3 images to a post at one time, no problem.  But, when I add 1 image, and modify that post to add image #2 & #3, #3's "insert Attachment 3" link doesn't function (2 works fine).  If I have 2 images in a post and modify it to add #3 image, same problem..."insert attachment 3" link doesn't work.  But I can manually type [attachment=3] into the post body to have it show inline.
I couldn't reproduce this bug.

d*mnest thing...it's happening again.  I had previously reported that 'bug 1' seemed to have cleared itself.  but after updating to 3.4, it's happened again.  Decided to change my attachment limit to 4 instead of 3.  it allowed me to modify to include 3 attachments, but clicking "insert attachment 4" did nothing.

It seems to be that when a post contains one less than the attachment limit, the "Insert attachment #" button doesn't work when it's modified to add that last attachment that'll meet the attachment limit.  In other words...using my setup...the post contains 2 of the allowed 3 attachments.  Modifying the post to add attachemnt #3 doesn't work.  Same when I changed the limit to 4.  when the post contains 3 attachments, modifying it & clicking "attached #4" doesn't work.

Quote from: RSI on May 15, 2015, 12:01:03 PM
That is now generating an error every time you view a page with inline attachments. I'm getting the error below in the log.

URL: http://mydomain.com/index.php?topic=466.75
File: /home/me/public_html/Themes/default/Display.template.php
Line: 499
just fyi that i'm not getting that error
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 15, 2015, 12:45:31 PM
Quote from: josx2 on May 15, 2015, 12:22:01 PM
d*mnest thing...it's happening again.  I had previously reported that 'bug 1' seemed to have cleared itself.  but after updating to 3.4, it's happened again.  Decided to change my attachment limit to 4 instead of 3.  it allowed me to modify to include 3 attachments, but clicking "insert attachment 4" did nothing.

It seems to be that when a post contains one less than the attachment limit, the "Insert attachment #" button doesn't work when it's modified to add that last attachment that'll meet the attachment limit.  In other words...using my setup...the post contains 2 of the allowed 3 attachments.  Modifying the post to add attachemnt #3 doesn't work.  Same when I changed the limit to 4.  when the post contains 3 attachments, modifying it & clicking "attached #4" doesn't work.

I use to get that on occasion too, but it only happened when trying to delete or make changes and then add new attachments without saving the post first. I realized it was just operator error and was my fault. If you remove attachments, etc. then save the post first before you try and add new attachments. Save the post first then go back and edit it after.

P.S. The error I'm getting happens when you view a page with inline attachments and then click on one to expand it.
Title: Re: Post and PM Inline Attachments
Post by: josx2 on May 15, 2015, 01:02:39 PM
Quote from: RSI on May 15, 2015, 12:45:31 PM
Quote from: josx2 on May 15, 2015, 12:22:01 PM
d*mnest thing...it's happening again.  I had previously reported that 'bug 1' seemed to have cleared itself.  but after updating to 3.4, it's happened again.  Decided to change my attachment limit to 4 instead of 3.  it allowed me to modify to include 3 attachments, but clicking "insert attachment 4" did nothing.

It seems to be that when a post contains one less than the attachment limit, the "Insert attachment #" button doesn't work when it's modified to add that last attachment that'll meet the attachment limit.  In other words...using my setup...the post contains 2 of the allowed 3 attachments.  Modifying the post to add attachemnt #3 doesn't work.  Same when I changed the limit to 4.  when the post contains 3 attachments, modifying it & clicking "attached #4" doesn't work.

I use to get that on occasion too, but it only happened when trying to delete or make changes and then add new attachments without saving the post first. I realized it was just operator error and was my fault. If you remove attachments, etc. then save the post first before you try and add new attachments. Save the post first then go back and edit it after.

well, it's that I want my members to be able to add additional pics to their post after the fact without having to what you explained above (if I understand correctly - remove the attachments, save the post, go back & modify it, re-add those additional attachments, then finally add the extra attachment).

This is the steps i'm doing (using an attachment limit of 4 on the server):
(oh...& I've got ILA setting to have attachments start at 1 if that helps with this problem)
- Create the post & select images to attach inline.  Let's say I select 3 images & put them inline
- Modify that post.  Select the 4th attachment and click "Insert Attachment #4".  Nothign happens.

== OR ==
- Create post & attach inline images (let's say 1 image this time)
- Modify that post.  Select 2 more images to attach & click "Insert Attachment #2" & "...#3".  Save post
- Modify that post again.  Select 4th image to attach & click "Insert Attachment #4".  Nothing Happens.


Quote
P.S. The error I'm getting happens when you view a page with inline attachments and then click on one to expand it.

ahhh...gotcha.

And I found another bug.   When you attach an image to a post, but DON'T put it inline, this error gets generated:

http://<mydomain>/forum/index.php?topic=480.msg3309
8: Undefined index: dontshowattachment
File: /<homepath>/public_html/forum/Themes/default/Display.template.php
Line: 540
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 15, 2015, 01:22:56 PM
Quote from: josx2 on May 15, 2015, 01:02:39 PM
(if I understand correctly - remove the attachments, save the post, go back & modify it, re-add those additional attachments, then finally add the extra attachment).

Yes...

Quote from: josx2 on May 15, 2015, 01:02:39 PM
- Modify that post.  Select the 4th attachment and click "Insert Attachment #4".  Nothign happens.

== OR ==
- Modify that post again.  Select 4th image to attach & click "Insert Attachment #4".  Nothing Happens.

I have my board set to 5 attachments max and all 5 will attach in-line without any problem. I just checked it. However, I did put everything back to v3.3.1 so I don't know about v3.4. I only saw the log error with v3.4 installed.
Title: Re: Post and PM Inline Attachments
Post by: josx2 on May 15, 2015, 01:49:29 PM
well, mine attaches 3, 4, 5 (whatever the max limit is) in the initial post.   It'll attach anything less than max-attach-limit w/out a problem as well.

The problem i'm experiencing is when the post contains one less than the max-attach-limit (so in the case of a 5 attach limit, the post has 4 attachments inserted inline).  The "insert attachment #" link doesn't work when trying to add that final attachment inline (which makes the # of attachments = max-attach-limit.  In this case...adding the 5th attachment inline)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 15, 2015, 02:31:54 PM
Quote from: josx2 on May 15, 2015, 01:49:29 PM
well, mine attaches 3, 4, 5 (whatever the max limit is) in the initial post.   It'll attach anything less than max-attach-limit w/out a problem as well.

The problem i'm experiencing is when the post contains one less than the max-attach-limit (so in the case of a 5 attach limit, the post has 4 attachments inserted inline).  The "insert attachment #" link doesn't work when trying to add that final attachment inline (which makes the # of attachments = max-attach-limit.  In this case...adding the 5th attachment inline)
Here's what's going on:  The javascript for inserting attachments is NOT included when the user CANNOT insert more attachments.  Obviously, this isn't right....  (Sigh)  Let me fix this problem.

EDIT: Edited last statement for clarity...

Quote from: josx2 on May 15, 2015, 01:02:39 PM
And I found another bug.   When you attach an image to a post, but DON'T put it inline, this error gets generated:

http://<mydomain>/forum/index.php?topic=480.msg3309
8: Undefined index: dontshowattachment
File: /<homepath>/public_html/forum/Themes/default/Display.template.php
Line: 540
This bug will be squashed with the new version as well....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 15, 2015, 03:01:49 PM
Uploaded v3.5 - April 14th, 2015
o Fixed issue where error generated on post with attachments, but no inline images.
o Fixed issue where insert attachment link didn't work if post had one less than maximum attachments.

@josx2 and @RSI: Thanks for the bug reports!!
Title: Re: Post and PM Inline Attachments
Post by: josx2 on May 15, 2015, 03:14:39 PM
PERFECT!!  Both issues fixed :)  well..dunno about the other error RSI reported on about clcking on an inline image to expand it.  Haven't tried that myself yet.

You da' man!  Thanks for being so on top of this mod! 
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 15, 2015, 06:02:21 PM
Quote from: dougiefresh on May 15, 2015, 03:01:49 PM
Uploaded v3.5 - April 14th, 2015

Guess what? Remember that problem I had before where the [attach=n] pics would not expand when I clicked on them, but the [attachment=n] pics would? Well, whatever you just did made the problem reappear and it's generating the error below now when it happens. After install if you go in there and uncheck and then recheck all of the boxes in Modifications Settings > ILA, it makes it happen and it wont go away, but this time it's generating an error. Maybe now it will explain why it's been happening.

URL: http://mydomain.com/index.php?topic=466.75
8: Undefined index: thumb_width
File: /home/me/public_html/Sources/Subs-InlineAttachments.php
Line: 555
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 15, 2015, 07:55:21 PM
I'm gonna have to do some rewriting of the image building code.  Something isn't right about it and I can't figure it out right now....
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 15, 2015, 09:21:34 PM
It's really strange though that what makes it happen is playing around with the check boxes in Modification Settings => ILA

Each time I uninstalled it I manually went into the database and dropped all of the ila entires in the smf_settings table before I reinstalled it again. There must be some combination making it happen. Right now I have v3.5 installed again and everything is working with no errors, but if I uncheck those boxes, save, then check them all again and save, it's going to happen again. As long as I leave them where they are now it's fine.

I'm going to install another test board tomorrow then export the smf_settings table into .csv format then install the mod and export the table again. Then play with the checkboxes until it happens then export the table once more. Maybe if I do a comparison of all 3 files and if something is getting changed or locked into a certain state it will show up.

I'll let you know if I find anything.
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 16, 2015, 05:48:34 PM
Doug,

I'm playing around with a test board now and if I find something I will let you know.

In the meantime if anyone is interested the query below will find and replace all instances of [attach=n] with [attachment=n] in all of your posts. I just did it to my board and eliminated the problem.


UPDATE `smf_messages`
SET `body` = replace(body, '[attach=', '[attachment=')
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 17, 2015, 09:55:12 AM
I figured out what is causing it and it's in the smf_settings table. A new entry gets created after playing around with the checkboxes in Modifcation Settings => ILA that is not there until you play with those boxes and it stays and "0" and never changes again no matter what you do.

The entry that gets created is below and if I manually change it to "1" the problem stops.

ila_attach_same_as_attachment  0

That line is not there until you play with the checkboxes. What I did just to make sure was uncheck all of them and hit save. Then I rechecked all of them and hit save. Then I unchecked all of them again and hit save. Then I selected all of the boxes I wanted and hit save one last time. After doing that the ila_attach_same_as_attachment entry gets created in the smf_settings table and it stays at "0" and it will never change again unless you manually go into your database and change it to "1"

When that new entry gets created and is at "0" the two errors below are created when you view a post with [attach=n] in it. Then changing that entry to "1" makes it stop and the attachments expand again when clicking on them.

URL: http://mydomain.com/~/index.php?topic=1.0
8: Undefined index: thumb_width
File: /home/me/public_html/~/Sources/Subs-InlineAttachments.php
Line: 555

URL: http://mydomain.com/~/index.php?topic=1.0
8: Undefined index: thumb_height
File: /home/me/public_html/~/Sources/Subs-InlineAttachments.php
Line: 556

I guess the real questions is what's creating the extra entry in the smf_settings table and why does it lock it to "0"? Fix that and the problem is gone 8)

Title: Edits for Sunset theme?
Post by: debiwebi on May 18, 2015, 03:45:53 PM
Hi there,
I was using this plugin back in March on my fairly new forum, but had problems with some of the attachments being invisible and so disabled it.

Now that I have time to focus on this (I really want this mod to work on my forum) I spent some time playing around with it on my test forum. So far, so good, with the Curve default theme! I especially love the float capability. When I first started using the mod I had a couple of errors, but it seems to be fine now. It may have been before I turned on "make sure attachment is 1." I'll attach the errors just so you can see them.

When I was installing the mod, I got an error message for my custom theme (I'm using Sunset 2.0 with some style changes). Error message attached. As a result, the Insert and Clear attachment links show: inactive javascript:void(0); and of course the mod doesn't work.

What do I need to add to Sunset's Display.template.php to make this mod work? Is there anything else I need to know about?

Thanks, I appreciate it.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 18, 2015, 04:05:37 PM
The next version will have support for the Sunset theme.  However, if you want to do the edits manually,

Change this in your Themes\sunset-2-0-1-5\Display.template.php file:
// Show a special box for unpproved attachments...
to this:
// Show a special box for unapproved attachments...
and it'll install correctly in the Sunset theme. 
Title: Re: Post and PM Inline Attachments
Post by: debiwebi on May 18, 2015, 05:30:13 PM
Hi dougiefresh. Oh boy. I uninstalled & deleted the mod, fixed Display.template.php, reinstalled. I didn't get any warnings during install. The first post I made to test the mod did something really weird. The Insert and Clear links are still disabled, so I just hit Post. It deleted my greeking text and put some little marks in there (see screen capture, this also happened earlier today). They are barely visible unless highlighted. I copied & pasted into a .txt & enlarged the font -- it's my greeking at 1 pt.

I tried another post and although Insert and Clear are disabled, clicking Post gave me a normal looking post with the standard attachment at the bottom.

No new errors in the log.

If you're interested you can take a look at my tests, and if you become a member I'll even make you Admin so you can dig around. The test topics are here: www.tejadadesigns.com/upgrade21test/index.php?topic=7  You can see how nicely the mod is working when posted using the Curve theme: http://www.tejadadesigns.com/upgrade21test/index.php?topic=6

I'm attaching the Display file so you can check my handiwork.  :)

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 18, 2015, 07:23:24 PM
Something very wrong is going on here....  I don't understand why this is happening with the code....  I'm going to investigate these bugs this week.
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 18, 2015, 10:51:24 PM
Quote from: dougiefresh on May 18, 2015, 07:23:24 PM
Something very wrong is going on here....  I don't understand why this is happening with the code....  I'm going to investigate these bugs this week.

That guys bug is really odd. I've installed this mod many many times and have never seen what he is seeing. Wonder is he has the no-sniff option checked?

I dug into this a little more and the only bug I found is connected to the below. The bbcode checkbox for controlling ila_attach_same_as_attachment doesn't get created in the smf_settings table during install and when you play with the boxes to where if finally shows up the bbcode checkbox has no control over it.

InlineAttachments.english.php

Find:
$txt['ila_attach_same_as_attachment'] = '<strong>attach</strong> bbcode same as <strong>attachment</strong>?';

That will never work, cannot have dual <strong></strong> tags in there. Not really needed anyway.

Replace:
$txt['ila_attach_same_as_attachment'] = 'Attach bbcode same as attachment?';

You probably need to also separate out the bbcode code and the width and height scaling code entirely within the Subs-InlineAttachments.php file.

Anyway, hope this helps...
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 18, 2015, 11:54:14 PM
Quote from: RSI on May 18, 2015, 10:51:24 PM
Quote from: dougiefresh on May 18, 2015, 07:23:24 PM
Something very wrong is going on here....  I don't understand why this is happening with the code....  I'm going to investigate these bugs this week.

That guys bug is really odd. I've installed this mod many many times and have never seen what he is seeing. Wonder is he has the no-sniff option checked?

I dug into this a little more and the only bug I found is connected to the below. The bbcode checkbox for controlling ila_attach_same_as_attachment doesn't get created in the smf_settings table during install and when you play with the boxes to where if finally shows up the bbcode checkbox has no control over it. The fix is below.

InlineAttachments.english.php

Find:
$txt['ila_attach_same_as_attachment'] = '<strong>attach</strong> bbcode same as <strong>attachment</strong>?';

That will never work, cannot have dual <strong></strong> tags in there. Not really needed anyway.

Replace:
$txt['ila_attach_same_as_attachment'] = 'Attach bbcode same as attachment?';

You probably need to also separate out the bbcode code and the width and height scaling code entirely within the Subs-InlineAttachments.php file.

Anyway, hope this helps...
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 19, 2015, 10:57:17 AM
P.S. You might also want to remove the <strong></strong> tags around the 1 in "Should first attachment should be numbered 1? That might possibly be causing a problem with certain browsers preventing that setting from working as well, but the dual tags in the other line were definitely preventing that one from working and that's all it was. It was actually that simple.

Anyway, I removed all of those tags in InlineAttachments.english.php within the v3.5 install package and reinstalled it again on my test board and the settings and everything work now. The problem is gone...
Title: Re: Post and PM Inline Attachments
Post by: debiwebi on May 19, 2015, 12:37:51 PM
Quote from: RSI on May 18, 2015, 10:51:24 PM
That guys bug is really odd. I've installed this mod many many times and have never seen what he is seeing. Wonder is he has the no-sniff option checked?

I don't even know what no-sniff is, but it is unchecked.

Quote from: RSI on May 18, 2015, 10:51:24 PM
Anyway, I removed all of those tags in InlineAttachments.english.php within the v3.5 install package and reinstalled it again on my test board and the settings and everything work now. The problem is gone...

I can do this, but the mod works with the default template. I'm thinking my problem is specific to Sunset.

Dougie: I didn't know if access to my server and db would be helpful. I've made a new board only accessible to Admins with that  information (http://www.tejadadesigns.com/upgrade21test/index.php?msg=21). I'd made the test forum a while ago, for another purpose, so already had it set up for individual access.
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 19, 2015, 01:42:57 PM
I'll let Doug take it from here, but the no-sniff option is to disable a restriction that prevents images from appearing when using IE, etc.

What I found are those <strong></strong> tags in the two lines in the InlineAttachments.english.php file are causing the check boxes not to work when checked. Basically it's preventing the actual settings in the database itself from changing from "0" to "1" when the boxes are checked. It's probably hit and miss and depends on what browser people are using, but it explains why some were having a problem like the problem I was having.

Anyway, good luck with it...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 19, 2015, 07:15:16 PM
@RSI:  I'm sorry I haven't been able to look into the issue lately, as other things have come up.  What you found is VERY interesting!  I would never have figured that those tags would have made that much difference in the settings pages.....  I'll incorporate these changes into the next mod version.  Once I get the html creation code straightened out, I'll release the next mod version.




@debiwebi: Okay, let's address each "complaint" one by one.   ::)

The first complaint is that the forum software is rendering your text at font size of 1 pixel.  Frankly, I'm puzzled as to what you expected the forum to do when that's exactly what you instructed it to do with [size=1px]....  It rendered the text at 1 pixel in height.  That's not a bug in the forum software OR my mod.  Hmmm.... You probably meant to use [size=1] instead....  ::)

The second complaint is that the "insert attachment" and "clear attachment" links are disabled.  I visited your forum and clicked on those links several times each, and they seem to work just fine for me each time.  Do you have Javascript enabled in your browser?  If not, that would make those links unresponsive when clicked.  Having a browser that doesn't support Javascript would produce the same result.  What browser are you running?  Did the "clear attachment" link work before you installed the mod?  I uninstalled the mod on your test forum and the "clear attachment" link still works for me....  :o

The third "complaint" (is that even the right word for this one?) is about the "nosniff" option.  If you read this topic, specifically starting here (http://www.simplemachines.org/community/index.php?topic=525705.msg3784937#msg3784937), you'll get some insight as to what that particular option is meant to do....  8)

I hope this helps with your problem.....  ;D
Title: Re: Post and PM Inline Attachments
Post by: RSI on May 19, 2015, 08:03:03 PM
Quote from: dougiefresh on May 19, 2015, 07:15:16 PM
@RSI:  I'm sorry I haven't been able to look into the issue lately, as other things have come up.  What you found is VERY interesting!  I would never have figured that those tags would have made that much difference in the settings pages.....  I'll incorporate these changes into the next mod version.  Once I get the html creation code straightened out, I'll release the next mod version.

The tag around the "1" in other line I mentioned is probably ok, but the dual tags in the attach bbcode same as attachment line is definitely preventing the checkbox from changing the value in the database. It might be because it starts out with '<strong> and maybe if it had a letter before the tag like 'make <strong>attach... it would work, but I seem to remember something about where you couldn't use the same tag on the same line twice.

To be safe I would just remove the tags from both lines and not take any chances. I understand why you were wanting to make those words appear in bold on the page, but it created a Gotcha!

Anyway, have fun...
Title: Re: Post and PM Inline Attachments
Post by: SethStudent on May 21, 2015, 11:24:52 AM
This is debiwebi.
Sorry for the delay, I was not getting email notifications of new posts so I changed my email address and am now locked out of my account because I can't get the verification notice (which I wasn't expecting). But that's a different topic.

Quote from: dougiefresh on May 19, 2015, 07:15:16 PM
@debiwebi: Okay, let's address each "complaint" one by one.   ::)
The first complaint is that the forum software is rendering your text at font size of 1 pixel.

The thing is that I never made any font adjustments (or any other formatting) to the text. All I did was put some text in the box, add an attachment and click post. It did that font thing twice, only after I installed the Inline Mod and only when using the Sunset template.

Quote from: dougiefresh on May 19, 2015, 07:15:16 PM
The second complaint is that the "insert attachment" and "clear attachment" links are disabled.  I visited your forum and clicked on those links several times each, and they seem to work just fine for me each time.  Do you have Javascript enabled in your browser?  If not, that would make those links unresponsive when clicked.  Having a browser that doesn't support Javascript would produce the same result.  What browser are you running?  Did the "clear attachment" link work before you installed the mod?  I uninstalled the mod on your test forum and the "clear attachment" link still works for me....  :o

Did you change your template over to Sunset before testing? Again, the Mod works fine when using the default Curve. The problem happens only when I use Sunset. I use several different browsers: Firefox, Chrome, Opera and Safari (all Mac). I'll do tests using all four of them, I think I'd only tested with Firefox and Opera. Javascript is always on.

Quote from: dougiefresh on May 19, 2015, 07:15:16 PM
The third "complaint" (is that even the right word for this one?) is about the "nosniff" option.

That wasn't an issue for me, just something someone else brought up and I said I didn't know what it does.

I'll do more testing and get back to you if any issues come up. Right now I want get back into my real SMF account...
Title: Update on testing: for future consideration
Post by: SethStudent on May 24, 2015, 11:33:15 AM
Hi Dougie, it's debiwebi, I still can't log into my regular SMF account.

This morning I ran tests on your Mod using the Sunset theme on four different (Mac) browsers: Chrome, Opera, Safari, Firefox. It doesn't work for me in Opera 29, the other three work great. I get the same problem as before: the Insert Attachment link doesn't work. I manually added [attachment=0]. It deleted the text and added [/attachment][/font]. If I just click Post without Inserting, it makes the font 2 px. My third and final Opera test result is attached—even more formatting thrown in.

So... I just thought you'd like to know for the future. I think at this point I'll retire the Sunset theme and just stick with the default.

Something else I noticed: When Insert Attachment does work, it inserts attachment=0, but to add a margin and float, I have to change it to "attachment id=0." I don't recall reading that anywhere.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 24, 2015, 07:38:40 PM
My computer has been down for repairs/improvements, so I haven't been able to do much of anything lately.  Hopefully, within the next few days, it will be operational again.....  Once it is, I'll look into it again....
Title: Re: Post and PM Inline Attachments
Post by: Rayvon on May 28, 2015, 09:03:09 PM
For the most part this seems to be working fine for me and I haven't seen anything not post yet - but I do have an odd occasional error showing up in my log files ..

I use UTF8 English as the only language file available to users.

The errors;
One of two:
8: Undefined index: ila_insert
File: /home/newsi908/public_html/forums/Themes/default/Post.template.php
Line: 482

two of two:
8: Undefined index: ila_insert
File: /home/newsi908/public_html/forums/Themes/default/Post.template.php
Line: 466


The two lines from default/Post.template.php are

Line 466
<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a href="javascript:void(0);" onclick="insertAttachment(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + $modSettings['ila_one_based_numbering']), '); return false;">', $txt['ila_insert'] ,' ', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + $modSettings['ila_one_based_numbering']),'</a>)  (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)';

Line 482
setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a href="javascript:void(0);" onclick="insertAttachment(\' + current_attachment + \'); return false;">', $txt['ila_insert'] ,' \' + current_attachment + \')</a> (<a href="javascript:void(0);" onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)\' + \'</dd><dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(' . $txt['more_attachments'] . ')<\' + \'/a><\' + \'/dd>\');
Title: Re: Post and PM Inline Attachments
Post by: Rayvon on June 02, 2015, 10:56:15 PM
Quote from: rayvon on May 28, 2015, 09:03:09 PM
For the most part this seems to be working fine for me and I haven't seen anything not post yet - but I do have an odd occasional error showing up in my log files ..

I use UTF8 English as the only language file available to users.

The errors;
One of two:
8: Undefined index: ila_insert
File: /home/newsi908/public_html/forums/Themes/default/Post.template.php
Line: 482

two of two:
8: Undefined index: ila_insert
File: /home/newsi908/public_html/forums/Themes/default/Post.template.php
Line: 466


The two lines from default/Post.template.php are

Line 466
<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a href="javascript:void(0);" onclick="insertAttachment(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + $modSettings['ila_one_based_numbering']), '); return false;">', $txt['ila_insert'] ,' ', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + $modSettings['ila_one_based_numbering']),'</a>)  (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)';

Line 482
setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a href="javascript:void(0);" onclick="insertAttachment(\' + current_attachment + \'); return false;">', $txt['ila_insert'] ,' \' + current_attachment + \')</a> (<a href="javascript:void(0);" onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)\' + \'</dd><dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(' . $txt['more_attachments'] . ')<\' + \'/a><\' + \'/dd>\');

I toggled the eval option and have this showing instead:

8: Undefined index: ila_insert
File: /home/newsi908/public_html/forums/Themes/default/languages/Profile.english-utf8.php (main sub template - eval?)
Line: 482

8: Undefined index: ila_insert
File: /home/newsi908/public_html/forums/Themes/default/languages/Profile.english-utf8.php (main sub template - eval?)
Line: 466
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 04, 2015, 07:38:01 PM
I'm sorry I haven't been able to get back to you lately, as I've been working somewhere around 100 hours in the last 10 days....  I'll look into the bug report(s) that you reported....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 05, 2015, 09:11:50 AM
Uploaded v3.6 - June 5th, 2015
o Fixed language loading issue within Sources/Post.php.
Title: Re: Post and PM Inline Attachments
Post by: stucki on June 06, 2015, 04:34:18 AM
Hi,

after installing the mod i can´t open "read PM & write PM". After unstalling is all good:)

Failure if open action /index.php?action=pm;sa=send or /index.php?action=pm:

Template Parse Error!

There was a problem loading the /Themes/default/PersonalMessage.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected 't' (T_STRING), expecting ',' or ';' in .../Themes/default/PersonalMessage.template.php on line 1184
1175: {
1176: echo '
1177: <dl id="postAttachment2">
1178: <dt>
1179: ', $txt['attach'], ':
1180: </dt>
1181: <dd class="smalltext">
1182: <input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a href="javascript:void(0);" onclick="insertAttachment(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + $modSettings['ila_one_based_numbering']), '); return false;">', $txt['ila_insert'] ,' ', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + $modSettings['ila_one_based_numbering']),'</a>)
1183:
1184: // Show more boxes only if they aren't approaching their limit.
1185: if ($context['num_allowed_attachments'] > 1)
1186: echo '
1187: <script language="JavaScript" type="text/javascript"><!-- // --><![', 'CDATA', '[
1188: var allowed_attachments = ', $context['num_allowed_attachments'], ' - 1;


SMF installation 2.0.9, see below installed mods:

1. Post and PM Inline Attachments 3.6 [ Uninstall ]
2. SMF 1.1.20 / 2.0.9 Update 1.0 [ Uninstall ]
3. SMF 2.0.8 Update 1.0 [ Uninstall ]
4. To Buddies 1.01 [ Uninstall ]
5. Curve_centered_menu 1.4 [ Uninstall ]
6. SMF 2.0.7 Update 1.0 [ Uninstall ]
7. SMF 1.1.19 / 2.0.6 Update 1.0 [ Uninstall ]
8. SMF 2.0.5 Update 1.0 [ Uninstall ]
9. Last Post On MemberList 1.3 [ Uninstall ]
10. Search Box Permissions 1.0 [ Uninstall ]
11. Add Favicon.ico Support 1.101 [ Uninstall ]
12. Custom_Top_menu 1.4 [ Uninstall ]
13. Menu Buttons 1.1 [ Uninstall ]
14. Dougiefresh's Reorganized Admin Area 1.3 [ Uninstall ]
15. FARM - Font Awesome Responsive Menu 1.0.2 [ Uninstall ]
16. No Log Certain User Errors 1.0 [ Uninstall ]
17. Last Active On MemberList 1.4 [ Uninstall ]
18. Global Headers Footers 2.0.1 [ Uninstall ]
19. Highlighting on Theme Edit 0.7 [ Uninstall ]
20. SMF Notify Group 2.2 [ Uninstall ]
21. Add Table, Td, Tr Button 1.0 [ Uninstall ]
22. Voter Visibility 2.0 [ Uninstall ]
23. Allow Deny Boards 1.1 [ Uninstall ]
24. Better Profile Menu 1.8 [ Uninstall ]
25. Arantor CAPTCHA 1.0.8 [ Uninstall ]
26. Avatar on Member List 2.0 [ Uninstall ]
27. Copy Topics 1.6 [ Uninstall ]
28. Footer Menu 1.1.2 [ Uninstall ]
29. PM Informer 4.0.1 [ Uninstall ]
30. Forum Name in Browser Title 2.0.1 [ Uninstall ]
31. Activity in Profile 1.1 [ Uninstall ]
32. Add Avatar To Who Is Online Version 1.1 1.0 [ Uninstall ]
33. Misc Anti Spam 1.0 [ Uninstall ]
34. Add Join Date to Post 1.0 [ Uninstall ]
35. jQLightbox 0.6 [ Uninstall ]
36. Highslide 4 SMF 0.8.1 [ Uninstall ]
37. Event Reminder Mod for SMF2 2.31 [ Uninstall ]
38. Event Registration Mod 0.177 BETA [ Uninstall ]
39. Attachment Extension 2.0 [ Uninstall ]
40. SMF4Mobile Mod 1.0 [ Uninstall ]
41. PM Attachments 1.6 [ Uninstall ]
42. Aeva Media 2.10 [ Uninstall ]
43. Deutsche Kalender Tage! 1.00 [ Uninstall ]



Hope you can help me ;)
Title: Re: Post and PM Inline Attachments
Post by: stucki on June 06, 2015, 05:02:27 AM
Another problem:)

If put a image inline of a post here is no Highslide effects...

Checkbox at admin panel "Enable Highslide effects for inline attachment?" is aktivated.

In the picture in the appendix you can see how the image is displayed.

Thanks for help:)
Title: Re: Post and PM Inline Attachments
Post by: Rayvon on June 06, 2015, 11:30:59 AM
Quote from: dougiefresh on June 05, 2015, 09:11:50 AM
Uploaded v3.6 - June 5th, 2015
o Fixed language loading issue within Sources/Post.php.

I uninstalled 3.5 and deleted it, then downloaded and installed 3.6

I'm now getting a more frequent error

8: Undefined index: msg
File: /home/newsi908/public_html/forums/Sources/Subs-InlineAttachments.php
Line: 84


Line 84:
$id = ($msg_id == '' ? $context['ila']['msg'] : $msg_id);
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 06, 2015, 03:35:38 PM
Uploaded v3.7 - June 6th, 2015
o Fixed syntax error in PersonalMessage.template.php.
o Fixed undefined index error within Subs-InlineAttachments.php.
Title: Re: Post and PM Inline Attachments
Post by: stucki on June 07, 2015, 03:58:33 AM
Works thanks!


Quote from: stucki on June 06, 2015, 05:02:27 AM
Another problem:)

If put a image inline of a post here is no Highslide effects...

Checkbox at admin panel "Enable Highslide effects for inline attachment?" is aktivated.

In the picture in the appendix you can see how the image is displayed.

Thanks for help:)

But my second problem still exists. An inline attachment appears too large. In the preview, I only have the ability to scroll the image in a small window. Sorry, no highslide effects as with a normal attachment exist. What could be wrong?

How should the inline attachment displayed if everything is working correctly? Just like a normal attachment?


greeting
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 07, 2015, 06:40:29 PM
Quote from: stucki on June 07, 2015, 03:58:33 AM
But my second problem still exists. An inline attachment appears too large. In the preview, I only have the ability to scroll the image in a small window. Sorry, no highslide effects as with a normal attachment exist. What could be wrong?
First: Have you set the maximum width for images yet?  If not, go to Admin => Features and Options => Layout and set your maximum width (Max width of posted pictures (0 = disable)).  The mod respects this value... 

Second: Have you specified a size for the inline attachment?  Something along the line of [attachment id=1 width=600 height=400] (width and height are optional)  should work to limit the viewed area to 600x400 within the post and when you click on it, it should balloon to full size (or full screen, whichever is smaller)...  Other parameters are available.  Look at the first post for a full list...

Quote from: stucki on June 07, 2015, 03:58:33 AM
How should the inline attachment displayed if everything is working correctly? Just like a normal attachment?
This simple answer is it depends on the bbcode you use.  attach starts out as your average expandable thumbnail, whereas attachment displays the full thing.  attachthumb ONLY shows a non-expandable thumbnail....

Hope this helps you.
Title: Re: Post and PM Inline Attachments
Post by: Rayvon on June 08, 2015, 11:08:18 AM
Quote from: dougiefresh on June 06, 2015, 03:35:38 PM
Uploaded v3.7 - June 6th, 2015
o Fixed syntax error in PersonalMessage.template.php.
o Fixed undefined index error within Subs-InlineAttachments.php.

Installed shortly after you posted this fix, so far running without error in the log. Thank you for the fixes.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 08, 2015, 07:21:36 PM
Thank you for the bug reports, as well as the feedback!
Title: Re: Post and PM Inline Attachments
Post by: RSI on June 10, 2015, 03:33:39 PM
Doug,

Your latest v3.7 seems to be working, but it is generating one error in the log when you view a page with the inline attachments.

My test page has one [attach=n] and one [attachment=n]. It's also on my test board via a clean v2.0.10 install.

Error: 2: preg_match_all(): Unknown modifier '/'
File: /home/me/public_html/~/Sources/Subs.php
Line: 4477
Title: Re: Post and PM Inline Attachments
Post by: njtweb on June 27, 2015, 11:39:36 AM
Hi trying this out today.

after install these are the settings I selected.
Remove attachment image under post after in-post use? --->Checked
Show download link and counter under inline attachment? --->UnChecked
Turns "nosniff" option off? --->UnChecked
Should first attachment should be numbered "1"? --->UnChecked
"attach" bbcode same as "attachment"? --->Checked
Allow quoted attachment images from another post? --->Checked

I added the bbcode [attachment id=0][/attachment] to the top of my story. here http://minorleaguelegends.com/board/player-related-news-stories/report-former-nhl-player-burnett-in-coma/msg102/#msg102

However, it doesn't show up at the beginning of the story as it should. And it's still showing up at the bottom of the story with a download link.

Any help is greatly appreciated. Thank you in advance.
Title: Re: Post and PM Inline Attachments
Post by: njtweb on June 28, 2015, 10:59:46 AM
Any help would be greatly appreciated.
Title: Re: Post and PM Inline Attachments
Post by: RSI on June 28, 2015, 12:46:14 PM
Quote from: njtweb on June 28, 2015, 10:59:46 AM
Any help would be greatly appreciated.

Change [attachment id=0][/attachment] to only [attachment=0] with nothing after it.
Title: Re: Post and PM Inline Attachments
Post by: njtweb on June 28, 2015, 01:17:00 PM
Nope doesn't work. When I add the bbcode, it disappears like I never added it, either way.

I click on modify, add the bbcode, re-save it and nothing is there. I go back to modify and the bbcode I just added is gone. The link "Insert attachment" doesn't do anything either. I click on it and nothing happens.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 28, 2015, 05:12:19 PM
Right now, I'm working 7 days a week mandatory at my workplace, so it may be next week (my vacation) that I can figure out what is going on with it....

Quote from: RSI on June 28, 2015, 12:46:14 PM
Change [attachment id=0][/attachment] to only [attachment=0] with nothing after it.
Doing so only changes it in the post.  The code adds the closing tag before processing the message, so that shouldn't work to resolve anything....  (Just saying)
Title: Re: Post and PM Inline Attachments
Post by: njtweb on June 28, 2015, 05:36:52 PM
Ok, thanks for replying.

Yeh, I installed the mod, it all shows up in ACP as working but it doesn't work on the front end on my site. Hopefully you can figure it out because I really need to use this mod. I'll be happy to donate if you accept donations as well.

Thanks
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on June 29, 2015, 03:56:36 PM
Quote from: njtweb on June 28, 2015, 01:17:00 PM
Nope doesn't work. When I add the bbcode, it disappears like I never added it, either way.

I click on modify, add the bbcode, re-save it and nothing is there. I go back to modify and the bbcode I just added is gone. The link "Insert attachment" doesn't do anything either. I click on it and nothing happens.

I have the same issue. The insert attachment link doesn't work when the WYSIWYG editor is enabled and further more this editor deletes the attachment links on post edit. When I use the normal editor while editing and want to insert an ttachment afterwards I get the error "attachment does not exist". In preview mode I get the error "you are not allowed to view attachments". I also have problems to get this mod working properly. It seems to behave unstable.

My settings:
No max width / height and thumbnails, because my theme is responsive.
Perfect would be to display inline attachments only in posts as images with download link and attachments which are not used in posts should only be shown as link under the message. But it seems to be impossible right now.

LG Cres
Title: Re: Post and PM Inline Attachments
Post by: njtweb on June 30, 2015, 07:57:47 AM
Hmm....seems like this mod has some issues. I don't get errors, instead everything the mod is supposed to do is ignored like it's not even installed.
Title: Re: Post and PM Inline Attachments
Post by: Steve on June 30, 2015, 09:32:12 AM
Confirmed. It shows nothing for me on a test setup. Possible setting wrong? Or should the options show by default?
Title: Re: Post and PM Inline Attachments
Post by: dan4ever on June 30, 2015, 10:53:22 AM

Hi


I have 2 creations, but i will post the other in next post 


Is it possible to have a movie (.mpg4) as a attachment and to show up like a picture?
Now it show like a downloadlink.


/Dan
Title: Re: Post and PM Inline Attachments
Post by: dan4ever on June 30, 2015, 11:21:15 AM

Hi again...


Is it possible to use a other name for [attach1]


In swedish it will be [bilaga1]


And some text to the user, so they understand how to use it  (next to the button/area)


/Dan
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 30, 2015, 03:48:15 PM
Quote from: dan4ever on June 30, 2015, 10:53:22 AM
Is it possible to have a movie (.mpg4) as a attachment and to show up like a picture?
Now it show like a downloadlink.
At present time, there is no ability to embed videos attached as attachments.  I will investigate the possibility of embedding attachments as playable videos....

Quote from: dan4ever on June 30, 2015, 11:21:15 AM
Is it possible to use a other name for [attach1]

In swedish it will be [bilaga1]

And some text to the user, so they understand how to use it  (next to the button/area)
I've never heard of a mod allowing its users (admin or otherwise) to change the bbcode tag via the admin UI.  Disabling it, yes.... but not changing it via the admin UI....  Making these changes would make reporting issues to me... um, interesting...  I'm not sure whether doing these changes would be a good idea....  Anyone have input on this?
Title: Re: Post and PM Inline Attachments
Post by: yakyakyak on June 30, 2015, 04:00:27 PM
Quote from: njtweb on June 30, 2015, 07:57:47 AM
Hmm....seems like this mod has some issues. I don't get errors, instead everything the mod is supposed to do is ignored like it's not even installed.

It should be suspended as it doesnt do what it says on the box.
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on June 30, 2015, 05:25:07 PM
I hope not! I really need this mod, because this is the ONLY mod which compensates the lack of an inbuilt functionality to embed pictures in your posts from your own webspace through the UI! It's a real shame that SMF does not provide such a natural feature.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 30, 2015, 06:03:22 PM
Quote from: njtweb on June 27, 2015, 11:39:36 AM
Hi trying this out today.

after install these are the settings I selected.
Remove attachment image under post after in-post use? --->Checked
Show download link and counter under inline attachment? --->UnChecked
Turns "nosniff" option off? --->UnChecked
Should first attachment should be numbered "1"? --->UnChecked
"attach" bbcode same as "attachment"? --->Checked
Allow quoted attachment images from another post? --->Checked

I added the bbcode [attachment id=0][/attachment] to the top of my story. here http://minorleaguelegends.com/board/player-related-news-stories/report-former-nhl-player-burnett-in-coma/msg102/#msg102

However, it doesn't show up at the beginning of the story as it should. And it's still showing up at the bottom of the story with a download link.

Any help is greatly appreciated. Thank you in advance.
I can duplicate the issue you reported.  Let me see what I can do about this issue....
Title: Re: Post and PM Inline Attachments
Post by: margarett on June 30, 2015, 06:20:53 PM
Quote from: dougiefresh on June 30, 2015, 03:48:15 PM
I've never heard of a mod allowing its users (admin or otherwise) to change the bbcode tag via the admin UI.
(...)
I'm not sure whether doing these changes would be a good idea....  Anyone have input on this?
I confirm this. I also don't know any software that allows to change any code-related part via UI.
IMO that's not a good idea (and, TBH, I'm not even sure if our BBC parser allows the processing of variable-named tags - and I would guess it won't)

Quote from: yakyakyak on June 30, 2015, 04:00:27 PM
(...)
When one has nothing interesting to say, silence is a great option ;) Please use it more often...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 30, 2015, 06:29:09 PM
Quote from: margarett on June 30, 2015, 06:20:53 PM
I confirm this. I also don't know any software that allows to change any code-related part via UI.
Thanks for confirming this, margarett!

Quote from: margarett on June 30, 2015, 06:20:53 PM
IMO that's not a good idea (and, TBH, I'm not even sure if our BBC parser allows the processing of variable-named tags - and I would guess it won't)
Frankly, IMHO, implementing such a feature seems like a REALLY bad idea.... 

As a hypothetical problem solving exercise, it wouldn't be that difficult to do, as the tag itself is inserted by the source file and could be pulled from the $modSettings array.  For example, the bbcode definition hook could be done like this:
function BBCode_VNT(&$bbc)
{
global $modSettings;
$bbc[] = array(
'tag' => (isset($modSettings['variable_named_tag']) ? $modSettings['variable_named_tag'] : 'variable_named'),
'type' => 'unparsed_content',
'content' => '$1',
'disabled_content' => '$1',
);
}

But changing the tag by way of the admin UI would break ALL usages of the old tag unless other measures (such as a global find/replace) were implemented, all of which would consume major resources during the find/replace operation.... 

Quote from: margarett on June 30, 2015, 06:20:53 PM
Quote from: yakyakyak on June 30, 2015, 04:00:27 PM
(...)
When one has nothing interesting to say, silence is a great option ;) Please use it more often...
Thanks for saying what I couldn't figure out how to say nicely....  :P

Quote from: njtweb on June 27, 2015, 11:39:36 AM
I added the bbcode [attachment id=0][/attachment] to the top of my story. here http://minorleaguelegends.com/board/player-related-news-stories/report-former-nhl-player-burnett-in-coma/msg102/#msg102

However, it doesn't show up at the beginning of the story as it should. And it's still showing up at the bottom of the story with a download link.
I copied your referenced post onto my localhost forum and installed the mod there.  It seems that the ENTIRE problem is the mod's ability to add the message ID to the inline attachment tag when it is referenced between quotes....  I added a switch to disable that functionality so that the picture does show up where it is placed within the quote.  As soon as I figure out what is going on with the rest of the bug reports, I'll post the next version of the mod!

EDIT: What happens is when the inline attachment is placed between the quote tags, the mod attempts to modify the inline attachment tag so that the attachment is pulled from the quoted message instead of the current message.  When no message is referenced in the quote, it has no option but to strip out the inline attachments from that quoted message because it doesn't know what message to pull it from.  The code modification I did adds a switch to disable the described quote modification code....  Hope this helps you to understand what was going on....

Quote from: dan4ever on June 30, 2015, 10:53:22 AM
Is it possible to have a movie (.mpg4) as a attachment and to show up like a picture?
Now it show like a downloadlink.
I'll implement a bbcode tag for playing attached mp4 files within this mod....  Shouldn't be too hard to do.
Title: Re: Post and PM Inline Attachments
Post by: njtweb on June 30, 2015, 09:11:17 PM
Quote from: dougiefresh on June 30, 2015, 06:03:22 PM
Quote from: njtweb on June 27, 2015, 11:39:36 AM
Hi trying this out today.

after install these are the settings I selected.
Remove attachment image under post after in-post use? --->Checked
Show download link and counter under inline attachment? --->UnChecked
Turns "nosniff" option off? --->UnChecked
Should first attachment should be numbered "1"? --->UnChecked
"attach" bbcode same as "attachment"? --->Checked
Allow quoted attachment images from another post? --->Checked

I added the bbcode [attachment id=0][/attachment] to the top of my story. here http://minorleaguelegends.com/board/player-related-news-stories/report-former-nhl-player-burnett-in-coma/msg102/#msg102

However, it doesn't show up at the beginning of the story as it should. And it's still showing up at the bottom of the story with a download link.

Any help is greatly appreciated. Thank you in advance.
I can duplicate the issue you reported.  Let me see what I can do about this issue....

I saw you registered to test. Lemme know if you have any questions or need me to do anything. I really need to use this, and I'll be happy to donate to you, if you accept them.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 01, 2015, 03:22:27 PM
@njtweb and @CrescentEclipse: I noticed that both of you are using the WYSIWYG mode of the SMF editor.  I can confirm that this mod DOES NOT properly work with the SMF's WYSIWYG mode.  The attachment tags were removed from the message when I switched between modes.  I can also confirm that the ILA link beside the attachment upload box doesn't work in WYSIWYG mode.... I'm not sure how to fix this issue, but I am going to investigate this issue further....

I've attached a new copy of Subs-InlineAttachments.php to this post.  Can either (or both) of you replace the copy you have and report whether it solves ANY of your problems?  Note that it won't solve the WYSIWYG problem, as that's more a template issue than a source file issue...  Thanks in advance....

Quote from: yakyakyak on June 30, 2015, 04:00:27 PM
It should be suspended as it doesnt do what it says on the box.
I don't remember packaging it in a box.  I put it in a ZIP file.  If you got my mod in a box, GET YOUR MONEY BACK!!!  :P
Title: Re: Post and PM Inline Attachments
Post by: njtweb on July 01, 2015, 03:29:52 PM
Hi @Dougiefresh, I replaced with the new subs file and no change. The bbcode disappears once I re-save.

What do you mean "With the WYSIWYG" problem?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 01, 2015, 03:37:33 PM
Quote from: njtweb on July 01, 2015, 03:29:52 PM
Hi @Dougiefresh, do I uninstall the existing and reinstall with the new?
No, just upload the new file to your forum's Sources folder.  You may want to rename the original file, in the event that you encounter problems or want to revert back to the version 3.7 copy of the file.  There SHOULDN'T be any functionality issues with the new file, as I've tested it before attaching it to the post....

Quote from: njtweb on July 01, 2015, 03:29:52 PM
What do you mean "With the WYSIWYG" problem?
I've edited the post a few times  :P ::)  Lemme quote:
Quote from: dougiefresh on July 01, 2015, 03:22:27 PM
@njtweb and @CrescentEclipse: I noticed that both of you are using the WYSIWYG mode of the SMF editor.  I can confirm that this mod DOES NOT properly work with the SMF's WYSIWYG mode.  The attachment tags were removed from the message when I switched between modes.  I can also confirm that the ILA link beside the attachment upload box doesn't work in WYSIWYG mode.... I'm not sure how to fix this issue, but I am going to investigate this issue further....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 01, 2015, 03:41:37 PM
Quote from: njtweb on July 01, 2015, 03:29:52 PM
Hi @Dougiefresh, I replaced with the new subs file and no change. The bbcode disappears once I re-save.
Huh.... Disappointing.  Did you check the new option in the admin panel, by any chance?  (Sorry, forgot to mention that there was one...)

Quote from: njtweb on July 01, 2015, 03:29:52 PM
What do you mean "With the WYSIWYG" problem?
"With the WYSIWYG problem" means that probably no amount of changes in the files in the Sources folder will fix this issue.  Changes to the templates (Themes\default folder) will be required in order to solve this problem....  At this moment, the best "solution" is to disable WYSIWYG mode within SMF....  :-[
Title: Re: Post and PM Inline Attachments
Post by: RSI on July 01, 2015, 03:48:46 PM
Quote from: CrescentEclipse on June 30, 2015, 05:25:07 PM
because this is the ONLY mod which compensates the lack of an inbuilt functionality to embed pictures in your posts from your own webspace through the UI! It's a real shame that SMF does not provide such a natural feature.

People have been trying to tell the SMF team that for a long time and for some reason it always leads to arguments. They should make it a built in feature to where it allows you to insert images/attachments in-line. Then others could just come up with the mods for Highslide and other similar pop-up and manipulation add-on features. As long as the base feature was already there.
Title: Re: Post and PM Inline Attachments
Post by: njtweb on July 01, 2015, 03:53:01 PM
Here's what I have in admin. There's an empty check box.

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 01, 2015, 04:05:31 PM
Check that last box without a description beside it.  That's the "Don't add message ID to quoted inline attachment?" setting.

What mods do you have installed?  It might be helpful to know this....
Title: Re: Post and PM Inline Attachments
Post by: njtweb on July 01, 2015, 04:13:35 PM
Ok, I clicked the checkbox and tried the attachment BBCode again. No go


1.   Post and PM Inline Attachments   3.7   [ Uninstall ]
2.   Linked Words   1.0   [ Uninstall ]
3.   Footer Menu v.1   v.1   [ Uninstall ]
4.   RIAST: Remove Index & Add Smart Title   1.3.0   [ Uninstall ]
5.   EzPortal   3.0.3a   [ Uninstall ]
6.   Similar Topics   0.6   [ Uninstall ]
7.   More Spiders   1.2   [ Uninstall ]
8.   Google Translate for SMF 2.0   1.4   [ Uninstall ]
9.   Users mass actions   0.1.1   [ Uninstall ]
10.   Add Table, Td, Tr Button   1.0   [ Uninstall ]
11.   SRAVC - Separate Replies And Views Column   1.9.4   [ Uninstall ]
12.   Views and Replies + Table on Recent Posts   1.2.1   [ Uninstall ]
13.   Child Board Hover   1.0   [ Uninstall ]
14.   MessagePreviewOnHover   1.8   [ Uninstall ]
15.   Enhanced PM Popup   1.0.1   [ Uninstall ]
16.   Tidy Child Boards   1.4.1   [ Uninstall ]
17.   SA Twitter   1.2   [ Uninstall ]
18.   SA Facebook   2.0.5   [ Uninstall ]
19.   Show BBCode to guests   0.1.7   [ Uninstall ]
20.   SEO Sitemap   2.2.1   [ Uninstall ]
21.   Float BBCODE   1.0.2   [ Uninstall ]
22.   MicroData SEO Linktree   1.0   [ Uninstall ]
23.   Responsive Curve   1.0 Beta 5   [ Uninstall ]
24.   Bot Buster   1.1   [ Uninstall ]
25.   Anti Bot: Are You Human/Bot?   3.0   [ Uninstall ]
26.   Invitation Message In Your Face (IMIYF)   0.3.2   [ Uninstall ]
27.   Socialize   1.8   [ Uninstall ]
28.   Menu Buttons   1.1   [ Uninstall ]
29.   SMFConnect   1.0   [ Uninstall ]
30.   Add Favicon.ico Support   1.101   [ Uninstall ]
31.   SimpleAds   1.0.1   [ Uninstall ]
32.   New Topic Button   1.0   [ Uninstall ]
33.   Yet Another YouTube BBCode Tag   2.5   [ Uninstall ]
34.   Tagging System   3.0   [ Uninstall ]
35.   SMF Trader System   1.7   [ Uninstall ]
36.   Show JDALLAUI in Post and PM   1.2   [ Uninstall ]
37.   reCAPTCHA for SMF   1.0.0   [ Uninstall ]
38.   Profile Comments   2.2   [ Uninstall ]
39.   Pretty URLs   1.1.2   [ Uninstall ]
40.   NHL Video BBCode   1.0   [ Uninstall ]
41.   Align submit buttons in posts   1.0.4   [ Uninstall ]
42.   Say Thanks   1.3.3
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 01, 2015, 06:13:15 PM
Only the Mod "Resize Attached Images 2.4.1" and your mod. Nothing else.
Title: Re: Post and PM Inline Attachments
Post by: njtweb on July 01, 2015, 07:32:44 PM
Thats all you have and this mod doesn't work for you?
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 02, 2015, 03:20:21 AM
Exactly. I only want a solution to allow users to upload pictures and save them the trouble to resize their content before upload. This does th first mod. I also want the feature to use the uploded content in posts. Therefore the second mod. That's it ;)
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 02, 2015, 04:38:28 AM
Hm, it looks like the most issues are indeed related to the WYSIWYG editor. I disabled this option and now it seems to work better. I do not get the messed up attachment bbcodes, missing bbcodes or error messages anymore.

The only problems left are
Title: Re: Post and PM Inline Attachments
Post by: njtweb on July 02, 2015, 06:29:14 AM
Ok, I disabled WYSIWYG editor as well and I too have [you are not allowed to view attachments] now. While perms for all users are set to 'yes' to view attachments, (or checked)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 02, 2015, 04:48:09 PM
Quote from: CrescentEclipse on July 02, 2015, 04:38:28 AM
The misleading error message in preview mode [ You are not allowed to view attachments ]
Quote from: njtweb on July 02, 2015, 06:29:14 AM
Ok, I disabled WYSIWYG editor as well and I too have [you are not allowed to view attachments] now. While perms for all users are set to 'yes' to view attachments, (or checked)
Huh....  Thought I fixed this awhile back.... I can duplicate this bug report.

Quote from: CrescentEclipse on July 02, 2015, 04:38:28 AM
The message [ Invalid Attachment ] in quotes (with id) when the option "Allow quoted attachment images from another post?" is disabled (I think the mod should just be quiet here to not confuse the user too much)
I personally disagree with the mod being quiet in that situation.  Hwoever, I can add yet another option to silence the mod for this particular request.

Quote from: CrescentEclipse on July 02, 2015, 04:38:28 AM
When the option "Display image attachments as pictures under post" is disabled, the mod does not work (inline attachments are not displayed). This option seems essential to the mod, but does not allow the admin to only show download links under posts while showing inline attachments as images in posts! Makes no sense to me. Therefore I must use thumbnails to not waste screen space in the attachment section.
Hmmm....  Let me look into this bug report and get back to you...

Quote from: CrescentEclipse on July 02, 2015, 04:38:28 AM
I cannot use the advanced version 2.0 bbcodes. While the format [attachment={id},{width}][/attachment] works, e.g. the formats [attachment= id={id} width={width}][/attachment] and [attachment= id={id} width={width} float={float}][/attachment] do not. They only show plain text in the message. Sometimes the tag "id" gets changed to "1d". Strange...
You are including too many equal signs.  Immediately after the opening tag, you have an extra equal sign.  It should read like this:
[attachment id={id} width={width}][/attachment]
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 02, 2015, 10:18:08 PM
UPDATE:  I've added support for playing video files in the AVI and DivX format (requires the DivX codec - HTML/BBCode courtsey of PhpBB3 BBcodes (http://www.phpbb3bbcodes.com/viewtopic.php?f=3&t=267)), WMV (requires Windows Media Player - HTML/BBCode courtsey of PhpBB3 BBcodes (http://www.phpbb3bbcodes.com/viewtopic.php?f=3&t=265)), and MP4 and OGG files (requires a HTML5 browser - HTML courtsey of W3Schools (http://www.w3schools.com/HTML/html5_video.asp)).

I've also added an option to silence all error messages that the mod used to output....

Anyways, I've done enough for today.  I'm going to bed....
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 03, 2015, 05:34:02 AM
Quote from: dougiefresh on July 02, 2015, 04:48:09 PM
I personally disagree with the mod being quiet in that situation.  Hwoever, I can add yet another option to silence the mod for this particular request.

Quote from: dougiefresh on July 02, 2015, 10:18:08 PM
I've also added an option to silence all error messages that the mod used to output....

Hm, I was not suggesting to suppress all errors, only this particular one. I think, if a user quotes a post with an inline attachment, he/she maybe does not care about some bbcodes and just adds his/her message. In this case, the error message could imply the user himself/herself has done a mistake. Maybe I am thinking too much about comfort here?

Quote from: dougiefresh on July 02, 2015, 04:48:09 PM
You are including too many equal signs.  Immediately after the opening tag, you have an extra equal sign.  It should read like this:
[attachment id={id} width={width}][/attachment]

OKay, thank you, now the bbcode works. I am sure I tried this, but obviously did not :o
But you should update the info site of the mod, because I copied the bbcodes from there, including the redundant equal sign.

LG Cres
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 03, 2015, 07:13:57 AM
Quote from: CrescentEclipse on July 03, 2015, 05:34:02 AM
Quote from: dougiefresh on July 02, 2015, 04:48:09 PM
You are including too many equal signs.  Immediately after the opening tag, you have an extra equal sign.  It should read like this:
[attachment id={id} width={width}][/attachment]

OKay, thank you, now the bbcode works. I am sure I tried this, but obviously did not :o
But you should update the info site of the mod, because I copied the bbcodes from there, including the redundant equal sign.

LG Cres
:o WHOOPS!!!  I've fixed it for the next version.... and fixed the info stuff of the mod, too....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 03, 2015, 08:53:09 AM
Quote from: CrescentEclipse on July 02, 2015, 04:38:28 AM
The misleading error message in preview mode [ You are not allowed to view attachments ]
Quote from: njtweb on July 02, 2015, 06:29:14 AM
Ok, I disabled WYSIWYG editor as well and I too have [you are not allowed to view attachments] now. While perms for all users are set to 'yes' to view attachments, (or checked)
I've fixed this bug for the next version....  Beware that you still MUST complete uploading the attachment BEFORE you can preview it!  This is something that I haven't worked around yet....

Quote from: CrescentEclipse on July 03, 2015, 05:34:02 AM
Hm, I was not suggesting to suppress all errors, only this particular one. I think, if a user quotes a post with an inline attachment, he/she maybe does not care about some bbcodes and just adds his/her message. In this case, the error message could imply the user himself/herself has done a mistake. Maybe I am thinking too much about comfort here?
Hmm....  Okay.  I'll have to figure out how to implement that.  I've removed the suppress errors option from the mod for now....
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 03, 2015, 10:52:03 AM
Great support dougie! Thank you a lot!

But I personally would prefer to have a fix for the two major bugs. You do not have to waste your time for some nice to have features ;)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 03, 2015, 01:16:48 PM
Believe me, I am looking at trying to fix them.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 03, 2015, 01:28:46 PM
Believe me, I am trying to fix them.....  It's not like everything that can effect the output of this mod is contained in the Subs-InlineAttachments.php.  There are other places that the mod effects that can play havoc with my mod....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 03, 2015, 04:09:11 PM
Quote from: CrescentEclipse on July 02, 2015, 04:38:28 AM
When the option "Display image attachments as pictures under post" is disabled, the mod does not work (inline attachments are not displayed). This option seems essential to the mod, but does not allow the admin to only show download links under posts while showing inline attachments as images in posts! Makes no sense to me. Therefore I must use thumbnails to not waste screen space in the attachment section.
I fixed this bug report, too....  Had to further modify Sources/Display.php in order to override that option so I could get what I needed to get to display the picture/video....

Quote from: CrescentEclipse on July 02, 2015, 04:38:28 AM
The misleading error message in preview mode [ You are not allowed to view attachments ]
Quote from: njtweb on July 02, 2015, 06:29:14 AM
Ok, I disabled WYSIWYG editor as well and I too have [you are not allowed to view attachments] now. While perms for all users are set to 'yes' to view attachments, (or checked)
This bug got unfixed....  Trying to figure out WTF I messed up...
Title: Re: Post and PM Inline Attachments
Post by: Steve on July 03, 2015, 04:14:22 PM
Your avatar is so apropos ... :P
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 03, 2015, 06:16:42 PM
Uploaded v3.8 - July 3th, 2015
o Fixed issue with post preview reporting not allowed to view attachments.
o Added override of "Display attachments as pictures under post" option to show pictures when disabled.
o Added an option to stop adding message ID to quoted inline attachments.
o Added an option to allow playing attached videos within the post.
o Added support for playing attached MP4, OGG and WebM video files (requires HTML5 browser or QuickTime).
o Added support for playing attached WMV files (requires Windows Media Player).
o Added support for playing attached AVI and DivX video files (requires DivX codec to be installed).
o Fixed undefined variable errors when certain mod settings don't get set during install.




@Everybody: I'm going to work on compatibility with the WYSIWYG mode next.

Quote from: Steve on July 03, 2015, 04:14:22 PM
Your avatar is so apropos ... :P
Yup....  Some days, yes, definitely....
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 04, 2015, 04:35:13 AM
WOW!!! That was quick! Again, great support here!

I will review your code changes, because I woud like to understand where the problems were. (may take some time)
I also will test your new release and give feedback as soon as possible.

Quote from: Steve on July 03, 2015, 04:14:22 PM
Your avatar is so apropos ... :P

Indeed^^
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 04, 2015, 05:20:05 AM
Quote from: dougiefresh on June 30, 2015, 06:29:09 PM
It seems that the ENTIRE problem is the mod's ability to add the message ID to the inline attachment tag when it is referenced between quotes....  I added a switch to disable that functionality so that the picture does show up where it is placed within the quote.  As soon as I figure out what is going on with the rest of the bug reports, I'll post the next version of the mod!

EDIT: What happens is when the inline attachment is placed between the quote tags, the mod attempts to modify the inline attachment tag so that the attachment is pulled from the quoted message instead of the current message.  When no message is referenced in the quote, it has no option but to strip out the inline attachments from that quoted message because it doesn't know what message to pull it from.  The code modification I did adds a switch to disable the described quote modification code....  Hope this helps you to understand what was going on....

Hey dougie

I have questions about that modification or perhaps a understanding problem.
We have an option to allow quoted attachments and an option to forbid processing quotes now.

Let me think of an example. What will happen if an user quotes a post with an inline attachment and uploads a new attachment which will be inserted between the original quote tags? (I think this was the source problem?) This scenario with the two optiones in all possible (4) conditiones?

Is the mod capable of handling this situation? What settings are required?
I hope you understand my questions or my reasoning. Thanks.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 04, 2015, 07:47:30 AM
Quote from: CrescentEclipse on July 04, 2015, 05:20:05 AM
Hey dougie

I have questions about that modification or perhaps a understanding problem.
We have an option to allow quoted attachments and an option to forbid processing quotes now.

Let me think of an example. What will happen if an user quotes a post with an inline attachment and uploads a new attachment which will be inserted between the original quote tags? (I think this was the source problem?) This scenario with the two optiones in all possible (4) conditiones?

Is the mod capable of handling this situation? What settings are required?
I hope you understand my questions or my reasoning. Thanks.
Whoops....  This is what happens when I try to program when I'm tired....  ::)  :P  I'll remove the newly-introduced option....  I'll try to find the "source problem" report and fix that, too....

EDIT: Did a little thinking on your hypothetical situation.  I can alter what the mod places in the post so that the current message ID is attached to the new inline attachment.  For new posts, obviously they don't have a post ID at that time, so I'd have to resolve the bad post ID once the post has been saved to the database....
Title: Re: Post and PM Inline Attachments
Post by: njtweb on July 04, 2015, 08:11:43 AM
Working perfectly now. Great support dude.!
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 04, 2015, 08:15:20 AM
Hey hey, don't rush to a rash conclusion^^
Maybe I just miss the point. I think you had a reason for implementing these two different optiones?
If you want to explain it further, I will excitedly listen ;)
I don't want to confuse you :-X

EDIT

But does the quoted inline attachment has already an ID after you quoted it?
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 04, 2015, 10:11:32 AM
I'm done with the code review. Looks good to me, except one little slip in line 523. The $topic variable is refered to twice and I think $sourcedir isn't needed anymore? Anyways, I will install the update now and test a bit :)

Sry to keep bothering you, but the float=center tag does not work for me.
Is this a general problem or just me again? :laugh:
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 04, 2015, 11:03:17 AM
Quote from: CrescentEclipse on July 04, 2015, 08:15:20 AM
Hey hey, don't rush to a rash conclusion^^
Maybe I just miss the point. I think you had a reason for implementing these two different optiones?
If you want to explain it further, I will excitedly listen ;)
I don't want to confuse you :-X
Like I said, I was trying to program when tired.  I had forgotten I implemented an option to disable quoted inline attachments.

Quote from: CrescentEclipse on July 04, 2015, 05:20:05 AM
Let me think of an example. What will happen if an user quotes a post with an inline attachment and uploads a new attachment which will be inserted between the original quote tags? (I think this was the source problem?)
:o Sigh....  You just had to think up a situation that breaks the expected output of the mod, didn't ya?  :P  Version 3.9 addresses this situation by writing the message ID to the inline attachment tag when the "insert ILA" link is pressed....

Quote from: CrescentEclipse on July 04, 2015, 08:15:20 AM
But does the quoted inline attachment has already an ID after you quoted it?
Yes and no.  Under version 3.8 and below, what would happen is that the inline attachment tags would be modified with the message ID AFTER the user submitted it.  So inserting another ILA between the quotes that didn't belong to that quoted post would see that ILA tag assigned to the quoted post, not the new post you are writing....  As mentioned above, version 3.9 fixes this particular bug, so that when the user submits the entire post, the ILA tag already has an message ID attached to it and further modification isn't necessary.....

Quote from: CrescentEclipse on July 04, 2015, 10:11:32 AM
I'm done with the code review. Looks good to me, except one little slip in line 523. The $topic variable is refered to twice and I think $sourcedir isn't needed anymore? Anyways, I will install the update now and test a bit :)
Fixed this.

Quote from: CrescentEclipse on July 04, 2015, 10:11:32 AM
Sry to keep bothering you, but the float=center tag does not work for me.
Is this a general problem or just me again? :laugh:
I'll look into this report.  Version 3.9 makes sure that the parameters are in the correct order, so this might be the case with this particular bug report....

EDIT: Confirmed this bug....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 04, 2015, 01:57:37 PM
Uploaded v3.9 - July 4th, 2015
o Fixed the ILA float parameter so that float=center works as expected.
o Added code to make sure ILA tag parameters are in the correct order.
o Added code to add the message ID to quoted inline attachments BEFORE the user sees it.
o Removed the option added in v3.8 to stop adding message ID to quoted inline attachments.
o Altered templates to use version 2.0 bbcodes to insert inline attachments code.
o Altered templates to add the message ID to the insert inline attachments code.




Quote from: CrescentEclipse on July 04, 2015, 10:11:32 AM
Sry to keep bothering you, but the float=center tag does not work for me.
This was a CSS issue within the Subs-InlineAttachments.php file.  Turns out more CSS was needed in order to acheive the desired result...
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 05, 2015, 06:47:08 AM
Hi dougie, nice to see another new release ;)
I wasn't able to test version 3.8 fully and will therefore just go on to version 3.9.

Here are my results so far:

Subs-InlineAttachments.php, Line 635
A little style problem, I think. Additionally, when you just add a margin and no float, the download link will stick left regardless. Maybe it will be better to style the surrounding div whenever a download link is around here?

$divfloat = (isset($context['ila_params']['float']) ? ($context['ila_params']['float'] == 'center' ? ' style="margin-left: auto; margin-right: auto; display: block; "' : ' style="float: ' . $context['ila_params']['float'] . ';' . (!empty($context['ila_params']['margin']) ? ' style="margin:' . $context['ila_params']['margin'] . 'px' : '') . '"') : '');

New?
$divfloat = (isset($context['ila_params']['float']) ? ($context['ila_params']['float'] == 'center' ? ' style="margin-left: auto; margin-right: auto; display: block;"' : ' style="float: ' . $context['ila_params']['float'] . ';' . (!empty($context['ila_params']['margin']) ? ' margin: ' . $context['ila_params']['margin'] . 'px;' : '') . '"') : '');

The width tag does not work anymore. In the HTML code it looks like &nbsp;width="240"
Has this something to do with the new param order?
Can you explain what the new function ILA_Fix_Param_Order does?

The override for inline attachment works, but the normal attachments under the post are displayed as images as well. But why? As far as I understand the code this should not happen, because only when ILA mod grabs the attachment context it sets the override, right?

I tried out our hypothetical scenario with the following result:

Test 1: Quoted msg with an ILA without a msg ID.
Quoted bbcode [attachment=1,msg12377] (v1 format, only if the previous attachment has no msg ID)
New ILA bbcode [attachment id=1 msg=new] between quote.
Works properly, but after I click "edit" I see [attachment id=1 msg=12392 msg=12377]
I mean, it works, but now we have both msg IDs. Looks strange.

Test 2: Same procedure, but first save and then edit post with new ILA.
Problem does not occure. New ILA bbcode [attachment id=1 msg=12392]

Test 3: Quoted msg with ILA with a msg ID
Quoted bbcode [attachment id=1 msg=12386] (v2 format)
New ILA bbcode [attachment id=1 msg=new] between quote.
Does not work at all. After "edit" I see [attachment id=1 msg=12386] twice. The new ILA is only under the post as attachment.

Test 4: Same procedure, but first save and then edit post with new ILA.
New ILA bbcode [attachment id=1 msg=12396]
Does not work at all. After "edit" I see [attachment id=1 msg=12396] twice. The new ILA is only under the post as attachment.

Same problem (like in test 3 and 4) when inserting the ILA outside the quote!

Final remarks:
It depends on the format of the ILA bbcode if the ILAs get messed up or not. Fixing posts is possible. You only can use the new ILA in the quote if the old (quoted) ILA has v1 format.

Thanks again :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 05, 2015, 08:16:26 AM
Quote from: CrescentEclipse on July 05, 2015, 06:47:08 AM
Subs-InlineAttachments.php, Line 635
A little style problem, I think. Additionally, when you just add a margin and no float, the download link will stick left regardless. Maybe it will be better to style the surrounding div whenever a download link is around here?

$divfloat = (isset($context['ila_params']['float']) ? ($context['ila_params']['float'] == 'center' ? ' style="margin-left: auto; margin-right: auto; display: block; "' : ' style="float: ' . $context['ila_params']['float'] . ';' . (!empty($context['ila_params']['margin']) ? ' style="margin:' . $context['ila_params']['margin'] . 'px' : '') . '"') : '');

New?
$divfloat = (isset($context['ila_params']['float']) ? ($context['ila_params']['float'] == 'center' ? ' style="margin-left: auto; margin-right: auto; display: block;"' : ' style="float: ' . $context['ila_params']['float'] . ';' . (!empty($context['ila_params']['margin']) ? ' margin: ' . $context['ila_params']['margin'] . 'px;' : '') . '"') : '');
:o  Wow!  I completely missed that!  This is embarrassing....

Quote from: CrescentEclipse on July 05, 2015, 06:47:08 AM
The width tag does not work anymore. In the HTML code it looks like &nbsp;width="240"
Has this something to do with the new param order?
I don't think so, but I added some code to the ILA_Fix_Param_Order function in order to remove any occurrences of "&nbsp;" from the message.  I honestly don't know where it comes from...

EDIT: Altering the ILA_Fix_Param_Order function so that it doesn't use the "&" character fixed this particular problem....

Quote from: CrescentEclipse on July 05, 2015, 06:47:08 AM
Can you explain what the new function ILA_Fix_Param_Order does?
It puts all the parameters in order, so that parser will parse the ILA tag properly.  Beforehand, the parser refused to parse this:
[attachment id=0 msg=28 width=600]
Altering the parameter order so that the parameters are in proper order allows the parser to perform as expected.

Quote from: CrescentEclipse on July 05, 2015, 06:47:08 AM
The override for inline attachment works, but the normal attachments under the post are displayed as images as well. But why? As far as I understand the code this should not happen, because only when ILA mod grabs the attachment context it sets the override, right?
:o You see what I mean by other stuff affects the mod, just like how the mod functions affects the forum?  :-\  Let me look into this....

Quote from: CrescentEclipse on July 05, 2015, 06:47:08 AM
I tried out our hypothetical scenario with the following result:

Test 1: Quoted msg with an ILA without a msg ID.
Quoted bbcode [attachment=1,msg12377] (v1 format, only if the previous attachment has no msg ID)
New ILA bbcode [attachment id=1 msg=new] between quote.
Works properly, but after I click "edit" I see [attachment id=1 msg=12392 msg=12377]
I mean, it works, but now we have both msg IDs. Looks strange.
Confirmed and fixed for next version.

Quote from: CrescentEclipse on July 05, 2015, 06:47:08 AM
Test 2: Same procedure, but first save and then edit post with new ILA.
Problem does not occure. New ILA bbcode [attachment id=1 msg=12392]
Confirmed.

Quote from: CrescentEclipse on July 05, 2015, 06:47:08 AM
Test 3: Quoted msg with ILA with a msg ID
Quoted bbcode [attachment id=1 msg=12386] (v2 format)
New ILA bbcode [attachment id=1 msg=new] between quote.
Does not work at all. After "edit" I see [attachment id=1 msg=12386] twice. The new ILA is only under the post as attachment.

Test 4: Same procedure, but first save and then edit post with new ILA.
New ILA bbcode [attachment id=1 msg=12396]
Does not work at all. After "edit" I see [attachment id=1 msg=12396] twice. The new ILA is only under the post as attachment.
Still looking into these....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 05, 2015, 09:27:34 AM
Quote from: CrescentEclipse on July 05, 2015, 06:47:08 AM
The override for inline attachment works, but the normal attachments under the post are displayed as images as well. But why? As far as I understand the code this should not happen, because only when ILA mod grabs the attachment context it sets the override, right?
:-[ Silly me...  The override was actually a code change that ignored that fact that the particular option was checked.  When the forum loaded the context, the code changes I made got the forum to load the other relevant information necessary to make the inline attachments work.  What I failed to change was the display template so that it doesn't display the attachment as a picture...  It's been fixed for the next version....

Quote from: CrescentEclipse on July 05, 2015, 06:47:08 AM
Test 3: Quoted msg with ILA with a msg ID
Quoted bbcode [attachment id=1 msg=12386] (v2 format)
New ILA bbcode [attachment id=1 msg=new] between quote.
Does not work at all. After "edit" I see [attachment id=1 msg=12386] twice. The new ILA is only under the post as attachment.

Test 4: Same procedure, but first save and then edit post with new ILA.
New ILA bbcode [attachment id=1 msg=12396]
Does not work at all. After "edit" I see [attachment id=1 msg=12396] twice. The new ILA is only under the post as attachment.
Problems confirmed.  Looking into a solution....

EDIT: Found the solution.  Turns out the fix parameter function didn't empty the array used for processing the parameters after processing each tag, so things got reused, even though the params were from other ILA bbcodes...   :o  It's been fixed for the next version....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 05, 2015, 09:47:29 AM
Uploaded v3.10 - July 5th, 2015
o Fixed issue where msg parameter was added twice to ILA tags in new posts.
o Fixed ILA_Fix_Param_Order so that extraneous "&nbsp;" weren't added to the created link.
o Fixed ILA_Fix_Param_Order so that it doesn't reuse parameters from another ILA tag.
o Altered msg parameter to accept "new" as an acceptable parameter input for preview purposes.
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 05, 2015, 10:02:52 AM
Quote from: dougiefresh on July 05, 2015, 08:16:26 AM
EDIT: Altering the ILA_Fix_Param_Order function so that it doesn't use the "&" character fixed this particular problem....

I don't really understand what's going on there, but you will know what you are doing, hopefully ;D
I am not that experienced in PHP coding. I can read and understand the code, but writing is something else.

One question. Is there a reason why you used the v1 bbcode for quoted ILAs without ID?

Quote from: dougiefresh on July 05, 2015, 09:27:34 AM
:-[ Silly me...  The override was actually a code change that ignored that fact that the particular option was checked.  When the forum loaded the context, the code changes I made got the forum to load the other relevant information necessary to make the inline attachments work.  What I failed to change was the display template so that it doesn't display the attachment as a picture...  It's been fixed for the next version....

No problem, I know you can fix it ;)
But will the non ILA attachments show as pictures if the option "Display image attachments as pictures under post" is activated again? Theoretically, this should happen as long as the ILA mod options are really seperated from the standard attachment options, right?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 05, 2015, 11:26:48 AM
Quote from: CrescentEclipse on July 05, 2015, 10:02:52 AM
Quote from: dougiefresh on July 05, 2015, 08:16:26 AM
EDIT: Altering the ILA_Fix_Param_Order function so that it doesn't use the "&" character fixed this particular problem....
I don't really understand what's going on there, but you will know what you are doing, hopefully ;D
I am not that experienced in PHP coding. I can read and understand the code, but writing is something else.
Well, I changed the character used to split the tag string and the problem went away.  I'm not sure why, but I suspect that the parser had some play in that particular problem....

Quote from: CrescentEclipse on July 05, 2015, 10:02:52 AM
One question. Is there a reason why you used the v1 bbcode for quoted ILAs without ID?
The mod doesn't change which format that the bbcode is originally in, so if the inline attachment was created using older versions of the mod, then it will be changed slightly to reflect the quoted message it came from....

Quote from: CrescentEclipse on July 05, 2015, 10:02:52 AM
Quote from: dougiefresh on July 05, 2015, 09:27:34 AM
:-[ Silly me...  The override was actually a code change that ignored that fact that the particular option was checked.  When the forum loaded the context, the code changes I made got the forum to load the other relevant information necessary to make the inline attachments work.  What I failed to change was the display template so that it doesn't display the attachment as a picture...  It's been fixed for the next version....
No problem, I know you can fix it ;)
But will the non ILA attachments show as pictures if the option "Display image attachments as pictures under post" is activated again?
Yes, the non-inline attachments should show as pictures underneath the post if the option is activated again.

Quote from: CrescentEclipse on July 05, 2015, 10:02:52 AM
Theoretically, this should happen as long as the ILA mod options are really seperated from the standard attachment options, right?
Theoretically, yes, it should happen....

In practice, it's a bit more complicated that a simple "yes" or "no".  Because the mod needs the image information from the context loading code, I have to make alterations in order to make sure I can get that information.  I also have to edit other places to make sure a clean install will function correctly.  If another mod comes along and further messes with the code, then all bets are off...  That being said, find me a reproducible situation like that and I'll try to fix my mod to accommodate that situation.

O:) Side question: Should the options to this mod be moved under Attachments and Avatars?  Looks to be a more natural fit than Modification Settings....
Title: Re: Post and PM Inline Attachments
Post by: Niko_Bellic on July 05, 2015, 01:01:42 PM
Very nice mod. I like the ability to put my images where I want them in the posts.


As to your Side question: Should the options to this mod be moved under Attachments and Avatars?  Looks to be a more natural fit than Modification Settings....

I think that would be good. :)
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 05, 2015, 04:06:01 PM
Quote from: dougiefresh on July 05, 2015, 11:26:48 AM
Quote from: CrescentEclipse on July 05, 2015, 10:02:52 AM
One question. Is there a reason why you used the v1 bbcode for quoted ILAs without ID?
The mod doesn't change which format that the bbcode is originally in, so if the inline attachment was created using older versions of the mod, then it will be changed slightly to reflect the quoted message it came from....

No and Yes. This was an ILA in the format [attachment=ID] without msg ID, from version 3.8 I think. When you quote such an ILA, then the mod adds the msg ID in v1 format, not v2 as expected. But I have not tested the behavior of v3.10 yet. But this is not a drama at all, so don't worry.

I will review the changes of your new version and test it tomorrow. I will give some feedback asap.

Quote from: dougiefresh on July 05, 2015, 11:26:48 AM
O:) Side question: Should the options to this mod be moved under Attachments and Avatars?  Looks to be a more natural fit than Modification Settings....

From my side, a nice to have change, but I can live with the settings as they currently are ;)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 10, 2015, 09:34:04 PM
Uploaded v3.11 - July 10th, 2015
o Added code to internally transform closed ILA tags ([attach]) into proper ILA tags.  Thanks, dcmouser (http://www.simplemachines.org/community/index.php?action=profile;u=25490)!
o Moved settings from Modification Settings to the Attachments and Avatars section.
o Fixed an undefined variable error in PersonalMessage.php.
o Made some performance optimization changes.




@dcmouser:  Thank you for the idea, as well as the code to implement closed ILA tags!

@Everybody:  For everybody who doesn't know what "closed tags" are, they are simply "[attach]".  The attachment numbers are assigned sequentially (aka: 1, 2, 3, etc).  Note that the [attach] tag is processed first, then [attachment], then [attachmini], then [attachthumb], then [attachurl].
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 11, 2015, 09:39:36 AM
It's been brought to my attention by CrescentEclipse that multiple changes made in version 3.9 have disappeared.  CrescentEclipse and I have been reviewing the code changes to see what has disappeared between v3.9 and v3.10 and I am going to reimplement those changes (again).  I apologize for any problems this has caused anybody, but I thought that I would let people know!
Title: Re: Post and PM Inline Attachments
Post by: RSI on July 11, 2015, 01:30:47 PM
Quote from: Niko_Bellic on July 05, 2015, 01:01:42 PM
As to your Side question: Should the options to this mod be moved under Attachments and Avatars?  Looks to be a more natural fit than Modification Settings....

It's fine where it is. I think all MOD's should automatically get installed under Modification Settings. It's unfortunate the majority of most mods don't do that because they ALL really belong there. That's why there is a Modification Settings place in the first place. I don't know how many times I've installed a mod and then had to go through and figure out where in the heck the settings to it were. Big thumbs down...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 11, 2015, 02:50:32 PM
@Everybody: I am releasing a public beta of v3.12 for testing here in this thread....  No, I'm not done fiddling yet with the code, as I may have found a reliable way to play MP4s using the ILA tag....

Quote from: RSI on July 11, 2015, 01:30:47 PM
It's fine where it is. I think all MOD's should automatically get installed under Modification Settings. It's unfortunate the majority of most mods don't do that because they ALL really belong there. That's why there is a Modification Settings place in the first place. I don't know how many times I've installed a mod and then had to go through and figure out where in the heck the settings to it were. Big thumbs down...
While I understand your reasoning, I disagree that ALL mods belong under Modification Settings.  Frankly, and I could be wrong on this, I personally think that the SMF team disagrees as well (not that I've talked to them), because in SMF 2.1 Beta 1, they stuck hooks EVERYWHERE in the admin area!  They obviously are trying to make it easier to add stuff to other areas without modification.

All I'm trying to do is to stick the settings where they seem to be a "natural fit".  While they "fit" just fine in the Modification Settings area, they fit better under the Attachments and Avatars (although I still don't understand why they grouped those two together like that)....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 12, 2015, 07:59:34 AM
Uploaded v3.12 - July 12th, 2015
o Resurrected some changes from v3.9 that somehow disappeared in v3.10.
o Fixed the ILA settings page so that it correctly saves the settings.
o Fixed ILA_Fix_Param_Order so that it doesn't drop all the parameters.
o Minor change to make sure internal message ID variable is set.
o Fixed some invalid regular expressions to make sure they get the message ID.
o Fixed error-creating operation within PersonalMessage.php.

@Everybody: This is the same as the beta published in the last post....  The last mod was sufficiently screwed up enough that this morning I decided to publish the beta as final v3.12....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 12, 2015, 11:21:03 AM
Uploaded v3.13 - July 12th, 2015
o Added "margin-left", "margin-right", "margin-top" and "margin-bottom" ILA parameters.
o Rewrote code to apply float and margin parameters to all ILA tags used.
o Fixed a few undefined errors within Subs-InlineAttachments.php.
o Fixed issue when quoted ILA tags were disabled, normal ILA tags didn't work either.
o Fixed issue where download link/counter didn't line up with image when margin was used.
Title: Re: Post and PM Inline Attachments
Post by: RSI on July 12, 2015, 11:40:35 AM
Quote from: dougiefresh on July 11, 2015, 02:50:32 PM
While I understand your reasoning, I disagree that ALL mods belong under Modification Settings.  Frankly, and I could be wrong on this, I personally think that the SMF team disagrees as well (not that I've talked to them), because in SMF 2.1 Beta 1, they stuck hooks EVERYWHERE in the admin area!  They obviously are trying to make it easier to add stuff to other areas without modification.

All I'm trying to do is to stick the settings where they seem to be a "natural fit".  While they "fit" just fine in the Modification Settings area, they fit better under the Attachments and Avatars (although I still don't understand why they grouped those two together like that)....

The problem is lack of consistency. Some mods you install have a redirect after install to where the settings are and then some don't. Sometimes on the modification download page when there is no redirect they have screen shots showing where the settings are and then sometimes they don't. With those mods you have to navigate around trying to figure out where in the heck they are. That's why the really belong under Modification Settings.

They should all really be installed under Modification Settings first with user ability to move them after, like a user customization feature.

Anyway, that's my two cents worth...

Title: Re: Post and PM Inline Attachments
Post by: adamtwar on July 12, 2015, 03:27:33 PM
I've installed Post and PM Inline Attachments version 3.13 on my forum http://forum.fontlab.com/ and whenever I click on the Insert Attachment 0 (or 1 etc.) link next to the attachment, the following BBCode gets inserted:
[attachment id=0 msg=31601
instead of:
[attachment id=0 msg=31601]
So the closing bracket is missing, which has quite terrible consequences when the user just saves the changes.
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 13, 2015, 03:02:03 AM
Hm, can't confirm this bug, works in my forum.
I tested new attachments, already uploaded attachments and quoted attachments. All closing brackets are present.

Can you post your settings and other mods you installed?
Maybe something else is the culprit?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 13, 2015, 03:52:06 AM
Uploaded v3.14 - July 13th, 2015
o Fixed the "attach bbcode same as attachment" option so that it works as expected.
o Fixed incorrectly closed tag with SCEditor.




@adamtwar:  The bug is confirmed and fixed for this version.  Thank you for reporting this!

@CrescentEclipse: The bug is present if you are running the SCeditor mod.  If you aren't, you wouldn't see it.

Title: Re: Post and PM Inline Attachments
Post by: adamtwar on July 13, 2015, 08:29:55 AM
Thank you for your express fix of the issue! :) It's all working well now.

I have another question. Have a look at:
http://forum.fontlab.com/bitfonter/(2015-06-25)-bitfonter-3-0-1-2015-for-mac-os-x-available!/msg31493/#msg31493
You'll see that I have one inline attachment there, inserted using attachthumb. I set the mod not to remove the attachments from the bottom of the post because, as you will see, I have Highslide Viewer (but the same effect is with the FancyBox 4 SMF). In the bottom list, I have the thumbnail, and if I click on it, it opens in Highslide.

How can I get the same behavior with an inline attachment? Is there a special shortcode (like attachthumblink or something :) ).

Also, I'd like to suggest that you add an option that allows me to customize which shortcode gets inserted with the "Insert Attachment" link that appears in the bottom list of attachments. By default, it's attachment but it would be great if I could set in the admin options which one it should be — it could be any of those you offer (attachment, attachmini, attachthumb etc.). This way, I could set the default standardized behavior for my users who just want to click on a link and have the same simple behavior.

Best,
Adam
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 13, 2015, 11:40:51 AM
Quote from: adamtwar on July 13, 2015, 08:29:55 AM
Thank you for your express fix of the issue! :) It's all working well now.
You're welcome!  Thank you for the feedback.

Quote from: adamtwar on July 13, 2015, 08:29:55 AM
I have another question. Have a look at:
http://forum.fontlab.com/bitfonter/(2015-06-25)-bitfonter-3-0-1-2015-for-mac-os-x-available!/msg31493/#msg31493
You'll see that I have one inline attachment there, inserted using attachthumb. I set the mod not to remove the attachments from the bottom of the post because, as you will see, I have Highslide Viewer (but the same effect is with the FancyBox 4 SMF). In the bottom list, I have the thumbnail, and if I click on it, it opens in Highslide.

How can I get the same behavior with an inline attachment? Is there a special shortcode (like attachthumblink or something :) ).
Use the "attach" tag, but make sure that the "attach bbcode same as attachment" option is unchecked and you should get the attachment thumbnail shown expandable to full size using Highslide.

Quote from: adamtwar on July 13, 2015, 08:29:55 AM
Also, I'd like to suggest that you add an option that allows me to customize which shortcode gets inserted with the "Insert Attachment" link that appears in the bottom list of attachments. By default, it's attachment but it would be great if I could set in the admin options which one it should be — it could be any of those you offer (attachment, attachmini, attachthumb etc.). This way, I could set the default standardized behavior for my users who just want to click on a link and have the same simple behavior.
I can do that.  The new option will show up in the ILA settings page.
Title: Re: Post and PM Inline Attachments
Post by: adamtwar on July 13, 2015, 01:24:40 PM
It seems that Post and PM Inline Attachments has a bug concerning deleting of attachments:

1. I add two attachments to a post (id 0 and 1).
2. I insert them in-line using the attachment shortcodes and publish by post.
3. Then I go to "Modify" to make some changes in the post. I uncheck attachment 1 from the list, and I upload a new attachment. So that should become attachment id 1 after I save the post. But instead, after publishing the post, in the place of my post where I had my attachment id=1 shortcode, a "missing image" with the filename of the OLD attachment (that I had already deleted) appears.

So far, the only way I could work around is that I upload the new attachment 2nd time so it gets id 2 (so I have id 0, 1 and 2, and I actually only use 0 and 2). So it seems that your plugin does not "refresh" the filenames behind the attachments.

Here's an example situation like this. You'll see some extra attachments at the bottom of the post, which are the ones I'd like to get rid of, but I cannot :)
http://forum.fontlab.com/b13/(2015-07-11)-the-forum-upgraded/

Title: Re: Post and PM Inline Attachments
Post by: adamtwar on July 13, 2015, 01:28:06 PM
Ps. But other than that, your mod works great, also in combination with Highslide. Thanks! :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 14, 2015, 06:26:57 PM
Sorry I didn't back to you yesterday, as a migraine tried to kill me yesterday.  I can confirm that this bug happens and I'm going to attempt to write something to handle it correctly.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 14, 2015, 07:41:03 PM
CrescentEclipse also has pointed out that the code logic for the tags isn't right.  It's been fixed for the next version.  I want to apologize in advance if the next update breaks things for anyone....
Title: Re: Post and PM Inline Attachments
Post by: brynn on July 19, 2015, 09:43:07 AM
Hi
I installed in SMF 2.0.10 with TinyPortal.  Can list all the other mods I use if necessary, but it's a long list.

Just wanted to report then when I upload attachements using inline options, and use Preview, instead of showing the attached image in the preview, it says "you are not allowed to view attachment".

However, after the message is posted, the images do show up inline, as expected.

I used the default settings for the mod.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 20, 2015, 04:17:32 AM
I can confirm this bug report. Let me look into it....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 20, 2015, 05:06:31 PM
@brynn: Okay, I've had time to do some investigation into the bug report you posted.  It turns out that the code that actually processes adding and/or deleting the attachment(s) happens much farther in the code that the if...then statement that redirects to preview a message.  I would have to move a large portion of code in order to make previewing a post with unsubmitted ILA images possible.  In addition, some solution would have to be found to temporarily store the new attachment data while "previewing" your post.  (I've already got some ideas, such as storing it in the attachment table, on this particular post...)  This doesn't mean it's not possible, but it's going to be some work in order to make everything function as expected.....

I've got a copy of the mod with a ton of fixes almost ready for making public.  Because of the large number of changes required, the changes involved with fixing your bug report won't be included.....

The temporary solution to this particular issue is to attach your images to the post, submit the post, then edit your post to preview/correct the image placement.....
Title: Re: Post and PM Inline Attachments
Post by: brynn on July 21, 2015, 07:58:48 AM
Well, it's not such a huge problem.  I just thought you might want to know about it.

You can see where the attachment will appear, because the error message (don't have permission to view) is in the correct place.  It's just you see that instead of the image.

Actually this mod fixes another problem I was having!  http://www.simplemachines.org/community/index.php?topic=538234.0

So I'm quite happy with it, even if this error message is never fixed   :D
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 21, 2015, 06:03:40 PM
One question: Would a thumbnail view of the attachment as you hover the cursor over it be helpful?  I'm thinking about adding this in for a future version.... (Not the upcoming version)
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 22, 2015, 03:24:01 AM
Regarding the error message, I personally would not change the behavior, just the message itself.
I would have used something more appropriate like "Preview currently not available"

Regarding the hover thumbnail. Hm, I personally don't need it, because I have deactivated thumbnails in my forum entirely.
Just my thoughts here ;)
Title: Re: Post and PM Inline Attachments
Post by: brynn on July 23, 2015, 05:25:46 AM
Do you mean a thumbnail if you hover over the error message?

Possibly I guess.  But users wouldn't really have any idea that it's there.  I don't normally mouse over the preview, so if I didn't know it was there, I'm not likely to find it during normal use (or accidentally).  I guess occasionally I'll click a link in a preview, but normally I don't mouse the preview at all.

But I like CE's idea, to change the error message....if it can be changed for the preview only.  I had the idea that error message was borrowed from other parts of SMF.  But if possible, maybe something like "attachment is here, but can't be previewed".

OH!  Well what about both?  What if the error message says "to preview attachment, hover your mouse here" or "hover mouse here to preview attachment".  With that, maybe no further fix would be necessary!  (especially if the fix is hard to do)

However, having said all that, I'm still quite happy with the mod as-is, despite the lack of preview  :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 23, 2015, 05:15:04 PM
Quote from: dougiefresh on July 21, 2015, 06:03:40 PM
One question: Would a thumbnail view of the attachment as you hover the cursor over it be helpful?  I'm thinking about adding this in for a future version.... (Not the upcoming version)
I should be more specific....  On the post page where the attachments are listed, I was thinking of showing a popup with the thumbnail of the attachment that the mouse is hovering over.  Go over to this website (http://wickham43.net/hoverpopups.php), scroll down until you see Popup on hover link; either image or information panel and hover your mouse over one of the images to see the kind of popup that I'm talking about....

This concept has nothing to do with the error message, and my description of the problem that generates the error wasn't accurate, either....  Unfortunately, it is only PART of the whole problem.....  And I don't know where the rest of it is....
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 24, 2015, 10:05:41 AM
Hmmm, this could be interesting, but would it benefit boards where thumbs are not available? I think no and if it does, this would most likely slow down the page, because all attachments need to be loaded in full size, right? And when thumbs are enabled you don't need a hover popup, do you?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 24, 2015, 06:35:54 PM
Quote from: CrescentEclipse on July 24, 2015, 10:05:41 AM
Hmmm, this could be interesting, but would it benefit boards where thumbs are not available?
Sure would.  It would make it easier to confirm which image you are wanting to use....  Plus I believe that thumbnails are generated regardless of whether they are shown in a post, but I'd have to dig through the code to make sure....

Quote from: CrescentEclipse on July 24, 2015, 10:05:41 AM
I think no and if it does, this would most likely slow down the page, because all attachments need to be loaded in full size, right?
It might slow down the page load a little, but it would only be the thumbnail that's loaded.

Quote from: CrescentEclipse on July 24, 2015, 10:05:41 AM
And when thumbs are enabled you don't need a hover popup, do you?
I cobbled together an image using an image thumbnail and a screenshot of the post editing page.  Hopefully, this will give you a better idea of what I'm talking about....  And no, I haven't coded it yet....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 24, 2015, 07:36:09 PM
I'm attaching a beta version of the mod version 3.15 that I've been working on.  Here is the changelog:
Quotev3.15 Beta - July 24th, 2015
o Added "border-style", "border-width" and "border-color" ILA parameters.
o Rewrote code that controls which image is shown to the user using the ILA tags.
o Added option in ILA settings to set inserted tag using the "Insert Attachment" link.
o Resurrected template change to use version 2.0 bbcodes to insert inline attachments code.
o Fixed code that reorganizes the ILA tags when insert new attachment and deleting existing attachment.
o Fixed issue where attachments weren't in the correct order in the Edit Post screen.
o Modified code to put the message ID in any ILA tags that don't have it upon posting.

I'd like some feedback on this new version......
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 26, 2015, 06:49:04 PM
Uploaded Official v3.15 - July 26th, 2015
o Added "border-style", "border-width" and "border-color" ILA parameters.
o Rewrote code that controls which image is shown to the user using the ILA tags.
o Added option in ILA settings to set inserted tag using the "Insert Attachment" link.
o Resurrected template change to use version 2.0 bbcodes to insert inline attachments code.
o Fixed code that reorganizes the ILA tags when insert new attachment and deleting existing attachment.
o Fixed issue where attachments weren't in the correct order in the Edit Post screen.
o Modified code to put the message ID in any ILA tags that don't have it upon posting.




Since no one wanted to test the beta, I decided to make it the official version 3.15.  Hopefully, this fixes some of the problems that have been brought to light by everybody, however, it does not fix issues with SMF's WYSIWYG editor, nor does it fix the new post/attachment previewing issue....
Title: Re: Post and PM Inline Attachments
Post by: brynn on July 26, 2015, 09:46:08 PM
Quote from: dougiefresh on July 24, 2015, 06:35:54 PM
I cobbled together an image using an image thumbnail and a screenshot of the post editing page.  Hopefully, this will give you a better idea of what I'm talking about....  And no, I haven't coded it yet....

Oh, I see what you mean now.  I didn't test the beta, because I somehow had the idea you wanted programming or coding advice, more than just user comments.  But I'll install and give user comments.  The "problem" is that I can't do that right away.  I've got some other stuff going on, that need my attention.  But I'll try it as soon as I can.  ;)

Thanks again for your immediate attention to my comments (even though you couldn't fix right away)   :)
Title: Re: Post and PM Inline Attachments
Post by: keyboard on July 28, 2015, 08:24:02 PM
Hi
I am having some problems trying to make this work.
My goal is to upload a Book in pdf and then use this mod to show a pic of the first page as a "Online attachment"

This is my settings .....................................see attached "settings.jpg"

This is the attachment that I want to use ..... see attached "image.jpg"

This is what I post .....................................see attached "image1.jpg"


When I "post" it or "Preview" it, I get a blank sheet . YIKES !!!!!!!!!!

Please advise on what I am doing wrong...

Ron
Title: Re: Post and PM Inline Attachments
Post by: brynn on July 29, 2015, 11:06:57 AM
Quote from: keyboard on July 28, 2015, 08:24:02 PM
Hi
I am having some problems trying to make this work.

That's how it's supposed to look in the message editor.  If you click Preview button, you will see an error message in the place where the attachment is supposed to be.

That's exactly the problem I reported.  I guess it can't be fixed right away.  However, after you post the message, the attachment will show up in the message.
Title: Re: Post and PM Inline Attachments
Post by: brynn on July 29, 2015, 11:11:56 AM
I need to report a different problem with this mod, for PM attachments. 

When you try inline PM in attachment, the attachment is at the bottom, and not inline.

In the place where the attachment is supposed to be, it says "[ Attachments has not been approved yet ]"

Does that mean that inline attachments are not supposed to work in PMs?

(Haven't had a chance to try the upgrade, but will as soon as I have a chance  :))
Title: Re: Post and PM Inline Attachments
Post by: dan4ever on July 29, 2015, 12:07:35 PM
Hi


My Picture I send as attachment are turned left or right.
Are there a god way to turn pic after upload to the forum???


/Dan
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 29, 2015, 07:27:48 PM
Quote from: brynn on July 29, 2015, 11:06:57 AM
Quote from: keyboard on July 28, 2015, 08:24:02 PM
Hi
I am having some problems trying to make this work.

That's how it's supposed to look in the message editor.  If you click Preview button, you will see an error message in the place where the attachment is supposed to be.

That's exactly the problem I reported.  I guess it can't be fixed right away.  However, after you post the message, the attachment will show up in the message.
Brynn, you nailed it!

Quote from: dan4ever on July 29, 2015, 12:07:35 PM
My Picture I send as attachment are turned left or right.
Are there a god way to turn pic after upload to the forum???
I guess I could add supporting code to utilize the BBCode With Style (http://custom.simplemachines.org/mods/index.php?mod=2505) mod's parameters/functions in order to perform the necessary operations.....

Quote from: brynn on July 29, 2015, 11:11:56 AM
I need to report a different problem with this mod, for PM attachments. 

When you try inline PM in attachment, the attachment is at the bottom, and not inline.

In the place where the attachment is supposed to be, it says "[ Attachments has not been approved yet ]"

Does that mean that inline attachments are not supposed to work in PMs?

(Haven't had a chance to try the upgrade, but will as soon as I have a chance  :))
No, that's not the way the mod is supposed to work.  I've fixed it for the next version.
Title: Re: Post and PM Inline Attachments
Post by: keyboard on July 29, 2015, 07:50:49 PM
Sorry for being such a pest , but I do not get an error message, I just get a blank white screen.............. and if I use the "Back " arrow, it will take me back to the message with no results...  I am on a MacBook Air if that is any help....

Please advise....

Ron
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 30, 2015, 10:29:03 AM
Quote from: keyboard on July 29, 2015, 07:50:49 PM
Sorry for being such a pest , but I do not get an error message, I just get a blank white screen.............. and if I use the "Back " arrow, it will take me back to the message with no results...  I am on a MacBook Air if that is any help....

Please advise....

Ron
I have a feeling that the problem is a lack of memory.  Yesterday, I was notified of a potentally "fatal flaw" in SMF's bbcode parser, at least in relationship to this mod and others with lots of parameters, that php actually runs out of memory during the permutation stage of parsing this mod's bbcode....  In this particular situation, you would see one of two things: (1) a blank screen -> what you have, OR (2) an error message indicating an out-of-memory situation. 

I've got a workaround for this issue for this mod, but a better solution for this particular "fatal flaw" in SMF's bbcode parser needs to be found  :-[  I made a "match while permuting" function, but it doesn't handle the quotes tags for some reason during my testing....  I suspect a few more tags would not be processed by my modifications, either.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 30, 2015, 12:15:13 PM
Uploaded v3.16 - July 30th, 2015
o Performance increase due to modification of parse_bbc function to deal with memory issue found.
o Rewrote to make border-style mandatory for use with border-width and border-color.
o Added ILA tags without border-style, border-width, or border-color parameters.
o Fixed issue where that borders weren't displayed correctly without float/margin paramters.
Title: Re: Post and PM Inline Attachments
Post by: keyboard on July 30, 2015, 06:02:31 PM
Uninstalled and installed v3.16...    Success  :) :) :) :) :)   Thank you very much for all your effort and talents, this is one mod that I will be using everyday at all my sites......

Much appreciated
Ron
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on July 31, 2015, 05:23:15 PM
Quote from: dougiefresh on July 24, 2015, 06:35:54 PM
Sure would.  It would make it easier to confirm which image you are wanting to use....  Plus I believe that thumbnails are generated regardless of whether they are shown in a post, but I'd have to dig through the code to make sure....

Okay, now I understand. I think this could be nice to have. But I think thumbnails are not generated if not enabled. Would this work with new attachments, because they are not uploaded at this time?

Hm, another question not related. Is it possible to make the mod a bit more multilanguage friendly? I want to translate it to german, but "Insert Attachment X" would be "Anhang X einfügen". Is it possible to move this number?
Title: Re: Post and PM Inline Attachments
Post by: keyboard on July 31, 2015, 07:31:59 PM
Hi
Are there any restrictions as far as sizes, jpeg, pngs, pdf's.....etc....?      The reason I ask is I can upload a 8 kb (jpeg) file no problem but a 1.5  meg jpeg file will not work.   

Most of my files are 3 meg pdf's.....  Will this be a problem ?

Thanks
Ron
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on August 01, 2015, 03:12:21 AM
The file size restriction has nothing to do with the mod. You can change the limit in admin menu (Forum / Attachments and Avatars).
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 01, 2015, 10:00:55 AM
Quote from: CrescentEclipse on July 31, 2015, 05:23:15 PM
Hm, another question not related. Is it possible to make the mod a bit more multilanguage friendly? I want to translate it to german, but "Insert Attachment X" would be "Anhang X einfügen". Is it possible to move this number?
Sure, I can do that!  Anything else?
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on August 02, 2015, 02:54:16 PM
Hey dougie,

I've getting around to updating some of my mods and think something has gone a big iffy with the removal / update..

If you wouldn't mind having a look, I've attached my Post.php to have a spy! - I think the issue is somewhere in there  :-[

Many thanks as always!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 02, 2015, 04:22:10 PM
Quote from: 420connect.info on August 02, 2015, 02:54:16 PM
Hey dougie,

I've getting around to updating some of my mods and think something has gone a big iffy with the removal / update..

If you wouldn't mind having a look, I've attached my Post.php to have a spy! - I think the issue is somewhere in there  :-[

Many thanks as always!
What version of the mod are you running?
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on August 02, 2015, 04:24:32 PM
Supposed to be the newest. I previously had 2.7 installed..
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 02, 2015, 04:29:59 PM
I've gotten my clean forum, installed with mod version 2.7, to uninstall correctly with the included file.  Hope this helps.....
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on August 03, 2015, 12:12:03 AM
Hmm,

with that one you had attached,  I'm getting:

QuoteFatal error: Call to undefined function ILA_Remove_Attachment() in /Sources/Post.php on line 1755

when I try to save a post with an inserted pic and when I try to preview I get:

QuoteFatal error: Call to undefined function ILA_Remove_Tags() in /Sources/Post.php on line 613

???



Quote from: dougiefresh on August 02, 2015, 04:29:59 PM
I've gotten my clean forum, installed with mod version 2.7, to uninstall correctly with the included file.  Hope this helps.....

Sorry I maybe wasn't clear on on last reply..

I am trying to install / use 3.16 but it appears removing 2.7 didn't seem to work as planned and I have some left overs..
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on August 03, 2015, 06:48:02 AM
I tried to clean up your posted file. Can you please check if it works now?
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on August 03, 2015, 11:34:28 AM
 :o Many Thanks CrescentEclipse, whatever you removed / added seems to have done the job!  ;D Thank youu!!
Title: Re: Post and PM Inline Attachments
Post by: aegersz on August 03, 2015, 12:27:03 PM
that will come in handy but i just upload images manually and display with BBC's ("img" and "center").

does it upload images automatically ?
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on August 03, 2015, 01:22:29 PM
No, not directly, but it uses attachments (which are uploaded files) to display images in your posts.
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on August 04, 2015, 11:39:12 AM
Okay, after a little playing around I noticed a few things were acting weird with that latest version..

I have now semi-solved the new issues that were created but I am back to where I was..

I have 2.7, not fully uninstalled but don't have 2.7 available to manually undo the changes.

Does anyone happen to have a copy I could get?  :-[






I've managed to remove the left overs from 2.7
Then install the new version and everything seems to be working as it should again, so far anyway!  :laugh:
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 04, 2015, 05:04:36 PM
Quote from: 420connect.info on August 04, 2015, 11:39:12 AM
Does anyone happen to have a copy I could get?  :-[
Here ya go.
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on August 05, 2015, 10:38:57 AM
Quote from: dougiefresh on August 04, 2015, 05:04:36 PM
Quote from: 420connect.info on August 04, 2015, 11:39:12 AM
Does anyone happen to have a copy I could get?  :-[
Here ya go.

Solved since I first posted but thanks anyway Dougie! ;)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 07, 2015, 07:50:16 PM
Quote from: CrescentEclipse on July 31, 2015, 05:23:15 PM
Quote from: dougiefresh on July 24, 2015, 06:35:54 PM
Sure would.  It would make it easier to confirm which image you are wanting to use....  Plus I believe that thumbnails are generated regardless of whether they are shown in a post, but I'd have to dig through the code to make sure....

Okay, now I understand. I think this could be nice to have. But I think thumbnails are not generated if not enabled. Would this work with new attachments, because they are not uploaded at this time?
You are correct.  If the option "Resize images when showing under posts" is unchecked OR the thumbnail width and/or height aren't set (aka: equal to 0), attachment thumbnails are not generated. 

Regarding the mod: If the thumbnail is available, it is used.  Otherwise, the full image is used.

Quote from: CrescentEclipse on July 31, 2015, 05:23:15 PM
Hm, another question not related. Is it possible to make the mod a bit more multilanguage friendly? I want to translate it to german, but "Insert Attachment X" would be "Anhang X einfügen". Is it possible to move this number?
I haven't had time to implement this feature.  It is a bit harder to implement in the code properly because of the fact that a user can inline a just-attached image that hasn't been uploaded yet.  The Javascript code has to take care of that, and I haven't had time to work on the mod in the last few days because of work....
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on August 10, 2015, 07:30:43 AM
Quote from: dougiefresh on August 07, 2015, 07:50:16 PM
I haven't had time to implement this feature.  It is a bit harder to implement in the code properly because of the fact that a user can inline a just-attached image that hasn't been uploaded yet.  The Javascript code has to take care of that, and I haven't had time to work on the mod in the last few days because of work....

Hm, what about a parameter in the language file like "%n" and then let the js code replace the parameter with the actual number?
Title: Re: Post and PM Inline Attachments
Post by: aegersz on August 10, 2015, 11:47:39 AM
i have a couple of questions:

does this mod change the way attachments are handled WITHOUT [attachment=n][/attachment] ?

in preview and SimplePortal i get  [ You are not allowed to view attachments ] - is that normal or how can i fix that ?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 10, 2015, 06:50:15 PM
Quote from: CrescentEclipse on August 10, 2015, 07:30:43 AM
Hm, what about a parameter in the language file like "%n" and then let the js code replace the parameter with the actual number?
That is the plan.  However, I haven't gotten around to doing it yet....

Quote from: aegersz on August 10, 2015, 11:47:39 AM
does this mod change the way attachments are handled WITHOUT [attachment=n][/attachment] ?
The only way the code is changed for attachment handling is that the code involved with removing attachments is moved after the code to add attachments.  For some weird reason, the mod doesn't work properly if it is the other way around....

Quote from: aegersz on August 10, 2015, 11:47:39 AM
in preview and SimplePortal i get  [ You are not allowed to view attachments ] - is that normal or how can i fix that ?
In preview mode, you must submit the post with the attachment at least once before you can preview it.  It is a known issue that I plan on fixing (if possible).

I need more information about your SimplePortal setup so that I can make an educamakated guess what the problem is.... :P
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 10, 2015, 07:51:10 PM
Uploaded v3.17 - August 10th, 2015
o Fixed issue with the post preview display of inline attachments.
o Fixed issue with download counter being display with image styles being applied.
o Modified code to make "Inline Attachment" string more language-friendly....
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on August 11, 2015, 03:07:30 PM
If I change the setting of starting numbering the attachments as 1 instead of 0, will it update the old '0' ones?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 11, 2015, 04:40:49 PM
Quote from: 420Connect.co.uk on August 11, 2015, 03:07:30 PM
If I change the setting of starting numbering the attachments as 1 instead of 0, will it update the old '0' ones?
No.  There are no plans (at the moment) to change this.  It would involve changing every other ILA tag so that the numbering scheme remains the same (aka: 2 refers to the same attachment that 1 does), and across multiple messages, that can get very time-consuming....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 11, 2015, 07:34:08 PM
Quote from: dougiefresh on August 11, 2015, 04:40:49 PM
Quote from: 420Connect.co.uk on August 11, 2015, 03:07:30 PM
If I change the setting of starting numbering the attachments as 1 instead of 0, will it update the old '0' ones?
No.  There are no plans (at the moment) to change this.  It would involve changing every other ILA tag so that the numbering scheme remains the same (aka: 2 refers to the same attachment that 1 does), and across multiple messages, that can get very time-consuming....
I thought about it some more.  Yes, it can be done.....  Lemme see how hard it would be to implement....  I still have to work through Thursday, and my wife and I have stuff planned for Friday.  My computer is also getting repaired this weekend (Fri/Sat), so it may not be this week....
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on August 14, 2015, 11:55:52 AM
Quote from: dougiefresh on August 11, 2015, 07:34:08 PM
Quote from: dougiefresh on August 11, 2015, 04:40:49 PM
Quote from: 420Connect.co.uk on August 11, 2015, 03:07:30 PM
If I change the setting of starting numbering the attachments as 1 instead of 0, will it update the old '0' ones?
No.  There are no plans (at the moment) to change this.  It would involve changing every other ILA tag so that the numbering scheme remains the same (aka: 2 refers to the same attachment that 1 does), and across multiple messages, that can get very time-consuming....
I thought about it some more.  Yes, it can be done.....  Lemme see how hard it would be to implement....  I still have to work through Thursday, and my wife and I have stuff planned for Friday.  My computer is also getting repaired this weekend (Fri/Sat), so it may not be this week....

Awesome stuff! Take all the time you need buddy and thank you very, very much!  :laugh:  O:)
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 15, 2015, 02:48:10 PM
Hello again,
I'm not sure if I have the settings wrong, or if the mod doesn't handle SVG, PDF, or TXT files.

Please look at this message on the test board of my forum:  http://forum.inkscapecommunity.com/index.php?topic=249.msg1841#msg1841

For my forum, it's important to be able to attach SVG files (as well as PDF and a few others).  They all work fine as regular attachments.

Or do I have the settings wrong?

Thanks for  your help  :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 15, 2015, 03:19:47 PM
Quote from: brynn on August 15, 2015, 02:48:10 PM
I'm not sure if I have the settings wrong, or if the mod doesn't handle SVG, PDF, or TXT files.
The mod doesn't handle anything other than standard images.  SVG files are NOT handled properly within SMF, though....  nor are they properly displayed as an image when they are attached to a post.  It might be possible to display it as an image, though....  Let me do some changes to see if I can properly display attached SVG files in this mod....

The mod doesn't display the contents of TXT files at this time.  If I were to add that feature, I assume that the contents of the TXT file would be displayed as part of the text?  Any special styling needed?  More info is necessary....

The mod doesn't display PDF files at this time, either.  Modifications might be able to be made to support displaying them....
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 15, 2015, 05:44:52 PM
Quote from: dougiefresh on August 15, 2015, 03:19:47 PM
.....  SVG files are NOT handled properly within SMF, though....  nor are they properly displayed as an image when they are attached to a post.  It might be possible to display it as an image, though....  Let me do some changes to see if I can properly display attached SVG files in this mod....

Hhmm, we haven't had any problems displaying SVG images in my SMF 2.0.1 forum.  (Or previously going back to 1.0.7)

Here's one embedded:  http://forum.inkscapecommunity.com/index.php?topic=87.msg698#msg698

And here's an attachment (regular, not inline):  http://forum.inkscapecommunity.com/index.php?topic=87.msg999#msg999 (notice it's under the PNG)

I don't know about technical specifications of "properly displayed", but those do the job for us just fine.

You can see that e mbedded, the image is dislayed.  And attached, the link allows the file to be downloaded.  A download link would be fine with me, for inline attachment.  But displaying the image would be a big plus!  (I know that phpBB forums don't display the SVG inline, but only the download link.)

I don't think I've tried to attach or embed a PDF.....  Maybe, but I can't put my finger on it, to show.

Thanks for the info about support of PDF and TXT files.  I don't know if TXT file would ever be used, but I was just trying to think of some regular type of files that I might expect should work.  To be honest, I've never tried to attach a TXT file with regular attachment anyway.

I guess the main comment I would make, is that to be able to use this mod on a professional kind of forum, I would expect it to handle the same kind of files that regular attachments can handle.  And I'm certainly looking forward to seeing this mod in its fully fledged version!  :)

(By the way, I noticed that you made the inline attachment so they show in the post preview.  Thank you very much!!)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 15, 2015, 08:04:54 PM
I've managed to get attached SVG files to show up correctly within posts.  It took a bit of work to figure out how it should be done.  For me, the real kicker was when you show me a post with a SVG shown within it.  Seeing how you managed to display a SVG file like that got me thinking how it could be done similarly....  So when the SVG files get pulled as an attachment, the proper mime type gets returned as well, enabling the browser to know what/how it should display....

I've also managed to get attached TXT files to display embedded in posts....  There is no security risk to doing so, as the HTML special characters (<, >, etc, etc) are converted so that they aren't mistaken by the browser as HTML tags...

Quote from: 420Connect.co.uk on August 11, 2015, 03:07:30 PM
If I change the setting of starting numbering the attachments as 1 instead of 0, will it update the old '0' ones?
I've got a beta almost ready with this feature implemented.  It still needs some serious testing, but it is supposed to pause every 5 seconds to report that it is still working on adjusting the ILA tags.  I was thinking that the mod should put the forum into maintenance mode temporarily, to minimize the mess that the user might see....  A word of caution with the beta:  If you uncheck the "1-based numbering" option and have a [attachment id=0], you will probably end up with this: [attachment id=-1]....
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 16, 2015, 12:18:34 PM
(http://)

I didn't do any managing, of my own.  Afaik, all SMF forums should be able to display SVG images.  The SVG image has to be uploaded to the internet, of course, just like any image.  And just put the URL in the img tag.

Making attached SVG file display as an image, afaik, would put SMF ahead of other types of forums.  As I mentioned, I know that phpBB doesn't display the image (for attached SVGs).  And neither does SMF, for that matter, for regular attachments!

Anyway, thanks for your work!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 16, 2015, 07:25:03 PM
Attached v3.18 Beta 1 - August 16th, 2015
o Seperated admin functions from general bbcode functions and placed in new file.
o Added support for SVG files as inline attachments.
o Added support for TXT files as inline attachments.
o Added support for PDF files as inline attachments.  (Not verified as working yet...)
o Added options to enable ILA support for SVG, TXT and PDF files.
o Added code to adjust the inline attachment IDs when "one-based numbering" option is changed.
o Reorganized ILA options so that their organization makes more sense (at least to me).
o Added default video width and height options.  (Set by default to 640x400)
o Made "Highslide" option visible, but disabled when no supported Highslide mods are installed.
o Made "EXIF" option visible, but disabled when EXIF mod isn't installed.




@Everybody: I need anyone willing to do some testing of the inline attachment ID adjustment code when the "one-based numbering" option is changed....  This beta should not only adjust ILA tags within regular posts, but PMs as well....  PLEASE do not do this testing in a production environment, as there may be issues with the new admin functions of this mod....  I haven't seen any yet, but I don't have a large database filled with ILA tags, either....

Remember, if you want to check the new functionality with SVG or TXT files, make sure you check the appropriate options before testing!

Quote from: brynn on August 16, 2015, 12:18:34 PM
Making attached SVG file display as an image, afaik, would put SMF ahead of other types of forums.  As I mentioned, I know that phpBB doesn't display the image (for attached SVGs).  And neither does SMF, for that matter, for regular attachments!
This gives me an idea for yet another mod....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 17, 2015, 08:03:16 PM
v3.18 Beta 1 doesn't work properly.  The "one-based numbering" adjustment code isn't written quite right, as it takes the parameters to continue its' work from the post data, but passes them via the URL....  :o
Title: Re: Post and PM Inline Attachments
Post by: Antes on August 17, 2015, 08:12:17 PM
Attachment removed on request.
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 18, 2015, 12:14:27 PM
Hhmm....I thought I read in this thread (a page or 2 back) that you made the post preview to show the image, in 3.18.  I installed 3.18, but it's still not showing the attached image in post preview.  I still see the error message.

Maybe I misunderstood?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 18, 2015, 06:42:14 PM
Quote from: brynn on August 18, 2015, 12:14:27 PM
Hhmm....I thought I read in this thread (a page or 2 back) that you made the post preview to show the image, in 3.18.  I installed 3.18, but it's still not showing the attached image in post preview.  I still see the error message.
You must still upload the attachment to the server at least once before it can be displayed as an inline attachment.  This issue is known and has not been fixed yet.  Have you uploaded the attachment before attempting to preview the post?  (Pressing preview instead of save does not count!)
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 19, 2015, 04:55:04 AM
Oooohh, Ok I understand now.

Then I will patiently wait  :)

At least we can see that the attachment is in the right place, until it's fixed.

Thanks again  :D
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 19, 2015, 07:43:43 PM
My advice would be to write your post, attach your files, then submit the post.  Once it has been submitted, then go back and edit it to adjust the position and/or size of the inline attachment to your specifications.  Previewing the post AT THAT POINT should work....  If it doesn't, let me know.  (I just worked a 12-hour shift and don't feel like looking at or testing the code tonight  :P )
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 20, 2015, 06:55:55 PM
Hi Dougiefresh,
Yes, that works.  But something else came up.

I'm not sure if this is how it's supposed to work or not.  I tried to place 4 small photos, side by side on the same line.  They all have the same height, but different widths.  (I wasn't sure if they would all fit on 1 line, but I thought at least 2 or 3 should fit.)

Here's the test/example on my forum:  http://forum.inkscapecommunity.com/index.php?topic=271.0

I can't explain technically what's going on.  But it looks like somehow the download link and info is getting separated from the image.

What I expected was that the 2nd image would be just to the right of the 1st image, and the download link and info is below each image.  Instead the 2nd image is just to the right of the link and info text of the 1st image.  And that's fine.  But somehow the link and info text of the 1st image is some distance below the 1st image (and that distance is exactly the height of the 2nd image).

(It seems like the 2nd image is trying to be in between the 1st image and the link and info text of the 1st image.)

Anyway, there's no rush on this.  I'm just reporting it, in case it's a bug.  Or if it's not a bug, just to find out if it's the correct way it's supposed to work.



Unrelated to this issue, but related to this mod -- I use another mod on my forum, SMF Articles (http://custom.simplemachines.org/mods/index.php?mod=1354).  For the most part, its editor is identical to the forum editor (and also, the PM editor is the same thing).  (Maybe not completely identical, technically.  But generally for the user, they're the same.)

Anyway, any chance of seeing Inline Attachments for SMF Articles?  Someday?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 20, 2015, 08:22:01 PM
Quote from: brynn on August 20, 2015, 06:55:55 PM
Yes, that works.
Good to hear!

Quote from: brynn on August 20, 2015, 06:55:55 PM
I'm not sure if this is how it's supposed to work or not.  I tried to place 4 small photos, side by side on the same line.  They all have the same height, but different widths.  (I wasn't sure if they would all fit on 1 line, but I thought at least 2 or 3 should fit.)

Here's the test/example on my forum:  http://forum.inkscapecommunity.com/index.php?topic=271.0

I can't explain technically what's going on.  But it looks like somehow the download link and info is getting separated from the image.

What I expected was that the 2nd image would be just to the right of the 1st image, and the download link and info is below each image.  Instead the 2nd image is just to the right of the link and info text of the 1st image.  And that's fine.  But somehow the link and info text of the 1st image is some distance below the 1st image (and that distance is exactly the height of the 2nd image).

(It seems like the 2nd image is trying to be in between the 1st image and the link and info text of the 1st image.)

Anyway, there's no rush on this.  I'm just reporting it, in case it's a bug.  Or if it's not a bug, just to find out if it's the correct way it's supposed to work.
Hmmm.... Let me look into this tomorrow.  I worked another 12 hour shift at my workplace and am feeling barely here enough to try to respond  :P

Quote from: brynn on August 20, 2015, 06:55:55 PM
Unrelated to this issue, but related to this mod -- I use another mod on my forum, SMF Articles (http://custom.simplemachines.org/mods/index.php?mod=1354).  For the most part, its editor is identical to the forum editor (and also, the PM editor is the same thing).  (Maybe not completely identical, technically.  But generally for the user, they're the same.)

Anyway, any chance of seeing Inline Attachments for SMF Articles?  Someday?
I would have to say "probably not" to this request.  If it used the regular attachments table, then definitely yes, I could make the ILA mod work with the SMF Articles mod.  Since the mod doesn't use the SMF attachment table and doesn't store the same amount of information about the attachments that SMF's attachment table does, it would be difficult to write code without having to do additional parsing of the article attachment in order to get that info...  Not impossible, but difficult...  However, I may be overthinking this since I'm tired....
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on August 21, 2015, 06:22:32 AM
@dougie
Hm, the image and download link misplacing could be a result of the missing div container to group them together?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 21, 2015, 05:50:58 PM
@brynn: In order to get them on a single line, they all need to be floated to the left.  For example:
[attachment id=0 float=left msg=17]   [attachment id=1 float=left msg=17]   [attachment id=2 float=left msg=17]   [attachment id=3 float=left msg=17]
would result in the attached image using the pictures specified:
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=525705.0;attach=243964;image).

Now, I've made some further changes to the unpublished copy of the mod so that it is an option to output something like this:
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=525705.0;attach=243966;image)
I assume that the second one is what you're going for.....

Now, if you wanted a specific amount of space around the image, use the margin parameter.
[attachment id=0 float=left margin=5 msg=17]   [attachment id=1 float=left margin=5 msg=17]   [attachment id=2 float=left margin=5 msg=17]   [attachment id=3 float=left margin=5 msg=17]
This would give you something like this:
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=525705.0;attach=243968;image)




@CrescentEllipse: I don't know if I could write something else to make it display properly.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 21, 2015, 08:40:42 PM
@brynn: I forgot to mention that if you turn off the download count option, the pictures will line up correctly without using the float option....  Otherwise, you will need to use the float option....
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 22, 2015, 02:10:06 AM
For my own use, I don't know that a margin is needed.  Either way meets my expectations.

Could the image size, dimensions, viewed info go below the download link/file name?  Like on a 2nd line of text, underneath each image?

If not, I'm still happy.  Just asking :)

Quote from: dougiefresh on August 21, 2015, 08:40:42 PM
@brynn: I forgot to mention that if you turn off the download count option, the pictures will line up correctly without using the float option....  Otherwise, you will need to use the float option....

First, I should say that I don't understand the code.

Is this float option something the user chooses when they attach the images?  Or is it an option for the admin?

If the user had the option not to show the download link, maybe the new float code would not be needed?

I keep the download option enabled, because we often use attachments to share SVG files.  Otherwise, the download isn't needed.  Although that's just me and my forum.  I can't speak for all, of course.
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on August 22, 2015, 05:50:00 AM
These are normal options every user can use by just adding them to the tag he/she inserts.
When an user does not want the download count, he/she just uses "attachmini" instead of "attachment".

You can change the standard tag in the admin settings to attachmini, if you want it.
You even can disable the download count for ILAs in the settings. This does not affect the download link of normal attachments under the post (which are not used as ILAs).
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 22, 2015, 06:58:11 AM
QuoteThese are normal options every user can use by just adding them to the tag he/she inserts.
When an user does not want the download count, he/she just uses "attachmini" instead of "attachment".

Well I can make a little faq for my forum, so people know how to use it (now that I know how).  But maybe it would be nice to have that little hint, along with any other special codes that can be used, where the user can see it when they make the attachment.

Or is it showing somewhere and I just haven't found it?
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 22, 2015, 07:10:49 AM
Ooohh..... :o 

I just noticed my smf error log has grown very large, in a very short amount of time.  It all seems to be coming from this mod, whenever a visitor looks at a message where this mod was used to attach something.

I'm not sure what kind of info to provide for you -- not sure what you might need  and also not sure how much is safe to show in public.

A lot of them say Line 802, and a lot of others say Line 746.  It looks like it changed from 746 to 802 when I upgraded from whatever I had before to 3.18.

Does that help?  Sure would not like this for the long term   ???
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 22, 2015, 09:40:04 AM
Quote from: brynn on August 22, 2015, 02:10:06 AM
Could the image size, dimensions, viewed info go below the download link/file name?  Like on a 2nd line of text, underneath each image?
I added a total of 6 options to the download count setting.  This is the Filename, Size, Dimensions and Count (3 Lines) setting.  What do you think?
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=525705.0;attach=243976;image)
Btw, the dog image has 40% opacity because on my test forum, it is an unapproved image.  Such images can only be seen by admin, moderators and the post author....  Everybody else gets the "This attachment hasn't been approved" message when viewing such a post....

Quote from: brynn on August 22, 2015, 06:58:11 AM
But maybe it would be nice to have that little hint, along with any other special codes that can be used, where the user can see it when they make the attachment.
I agree....  It would be nice....  Probably hard to code, though....

Quote from: brynn on August 22, 2015, 06:58:11 AM
Or is it showing somewhere and I just haven't found it?
Nope, such a "hint" isn't included in the mod.

Quote from: brynn on August 22, 2015, 07:10:49 AM
I just noticed my smf error log has grown very large, in a very short amount of time.  It all seems to be coming from this mod, whenever a visitor looks at a message where this mod was used to attach something.
The latest version of the mod isn't expressing an errors, so hopefully I've already solved the issue with the unpublished version....
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on August 22, 2015, 04:34:58 PM
Quote from: dougiefresh on August 17, 2015, 08:03:16 PM
v3.18 Beta 1 doesn't work properly.  The "one-based numbering" adjustment code isn't written quite right, as it takes the parameters to continue its' work from the post data, but passes them via the URL....  :o

Sorry to be a pest, but I wondered if you had got around to having another look into this?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 22, 2015, 07:21:06 PM
Sorry.  It's been a busy last 2 days, and aside from dealing with the two issues that I've mentioned already, I haven't accomplished much of anything on the mods....
Title: Re: Post and PM Inline Attachments
Post by: brynn on August 24, 2015, 03:20:13 AM
QuoteWhat do you think?

That looks fantastic!

QuoteThe latest version of the mod isn't expressing an errors, so hopefully I've already solved the issue with the unpublished version....

Awesome!  Looking forward to it  :)

New problem  (I have 3.17 installed)
In PM attachment, here is a screenshot of what I see after attaching an image to a PM and before sending....errr, well, it's pmattach.png.  No way to clear attachment, no way to place inline.

Next screenshot is what happens when I try to preview the PM (testattachpre.png).  Says "fatal error...."  However, the message can be sent with attachment intact....just not inline.

No rush.  Just letting you know  :)
Title: Re: Post and PM Inline Attachments
Post by: CrescentEclipse on August 24, 2015, 06:49:00 AM
Confirmed. Same problem here in normal posts (not PMs). The page stops loading at the position where the first insert link should be.

The function should be sprintf not sprint. I modified the code and this works for me. I also changed the links to buttons, looks more intuitive to me. The class "btn btn-primary btn-sm" can be ignored / deleted, this is only because my SMF style uses bootstrap framework. I attached the file, maybe it is helpful ;)

v3.17 mod

LG Cres
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 24, 2015, 07:36:23 PM
Quote from: dougiefresh on August 22, 2015, 09:40:04 AM
Quote from: brynn on August 22, 2015, 06:58:11 AM
But maybe it would be nice to have that little hint, along with any other special codes that can be used, where the user can see it when they make the attachment.
I agree....  It would be nice....  Probably hard to code, though....
I found some information about creating a inline pop-up window when a button is pressed....  Doesn't look particularly hard to implement using JQuery....  I'll see what I can do about implementing it for the next version....

Quote from: CrescentEclipse on August 24, 2015, 06:49:00 AM
The function should be sprintf not sprint. I modified the code and this works for me.
Fixed for the next version....

Quote from: CrescentEclipse on August 24, 2015, 06:49:00 AM
I also changed the links to buttons, looks more intuitive to me. The class "btn btn-primary btn-sm" can be ignored / deleted, this is only because my SMF style uses bootstrap framework.  I attached the file, maybe it is helpful ;)
I did one of the changed operations manually and I'm kinda undecided on this particular issue at this moment....  Although it probably would make implementing the inline pop-up window easier....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 28, 2015, 08:27:58 AM
Uploaded v4.0 - August 28th, 2015
o Added code to adjust the inline attachment IDs when "one-based numbering" option is changed.
o For post author, admin and moderators, unapproved image attachments are shown as partly transparent.
o Fixed issue with links in ILA download info not being formed correctly.
o Fixed issue with ILA download info not showing the original image size correctly.
o Seperated admin functions from general bbcode functions and placed in new file.
o Reorganized ILA options so that their organization makes more sense (at least to me).
o Revised the video playing code so that hopefully it works better now.
o Added default video width and height options.  Defaults to 640x400.
o Added support for SVG files as inline attachments and option to enable it.
o Added support for TXT files as inline attachments and option to enable it.  Inserts as part of post.
o Added support for PDF files as inline attachments and option to enable it.  Defaults to 500x600.
o Added option to control unapproved image opacity percentage.  0 returns "unapproved" message.
o Made "Highslide" option visible, but disabled when no supported Highslide mods are installed.
o Made "EXIF" option visible, but disabled when EXIF mod isn't installed.
o Modified install code so that only mod settings that aren't already set are set.




Changes to the Video code: Version 3.x used strictly HTML5 to try to show video to the users.  Version 4.x uses HTML5 plus Flash fallback to attempt to show video to users.  You will NEED to attach a MP4 AND OGV file to the post.  This mod does not convert MP4/OGV/WebM formats to any other format!!!  You may also post a JPG or PNG as the screenpost of the video.  They must all be named the same, including case-sensitivity.  In other words, Video.mp4, Video.ogv and Video.png must all be attached to the same post.  If the video cannot be shown using HTML5, it will attempt to fall back to using the flash-based JW Player in order to show the video.

Regarding Popups & Buttons:  Nothing has been done on these issues.  They will probably make an appearance next version....

Screenshots: A new screenshot of the Settings page has been attached on the mod page.
Title: Re: Post and PM Inline Attachments
Post by: RSI on August 29, 2015, 01:35:55 PM
Doug,

Have you had the chance to try it on v2.1b2 yet?

I just did and it crashes the posting page.

I haven't been on here in a while and just installed the new beta and was playing around with it.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 29, 2015, 02:33:34 PM
Uploaded v4.1 - August 29th, 2015
o Added option to switch between using HTML5 video tags with flash fallback and using flash only.
o Fixed minor issue where the forum crashes on the Post page.
o Fixed install-time error in add_remove_hooks.php when .htaccess doesn't exist.




@RSI:  Whoops!  I've fixed it for this version.  Thank you for pointing that one out!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 04, 2015, 07:49:18 AM
NOTICE: In the nightly version found on GitHub, the SMF team has reworked the section of the parse_bbc function that used the permute function so that it no longer needs it, instead relying on a complete different implementation to address the issue brought up in the REPORT: Potentially "Fatal Flaw" in SMF's bbcode parser (http://www.simplemachines.org/community/index.php?topic=538611.0) thread.....  In the next few days, I will release an update that will make that particular operation optional....
Title: Re: Post and PM Inline Attachments
Post by: RSI on September 08, 2015, 02:07:05 PM
Doug,

I forgot to give you this feedback, but with the v2.1 betas it will only let you place 1 attachment in-line so there is a bug with this mod installed. If you try to add more attachments it doesn't work. Attach one file and save it, then go back and try to add another attachment and you will see the problem. Not sure whether it's that important at the moment since it's still in Beta mode, but that's what I noticed.

Anyway, I switched my board over to XenForo this weekend because I got tired of waiting for v2.1 and the lack of this essential built-in feature along with a couple others. I may eventually play around with v2.1 when it's finally released, but we will see. Might not be worth it though.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 08, 2015, 05:02:27 PM
I'll look into this bug report....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 09, 2015, 07:21:40 PM
Uploaded v4.3 - September 9th, 2015
o Added MIME types for AVI and WMV files.
o SMF 2.1: Fixed Javascript issue where option to upload additional files wasn't available.
o SMF 2.1: Fixed formatting issue for download/viewed counts underneath inline attachments.
o SMF 2.1: Fixed missing clip icon underneath inline attachment in download/viewed counts.

Quote from: RSI on September 08, 2015, 02:07:05 PM
I got tired of waiting for v2.1 and the lack of this essential built-in feature along with a couple others.
Well, that's what mods are for, to fill in gaps that people need and/or request.  If you don't mind me asking, what other features are you wanting?  If they aren't already being done, I might be able to develop a mod for it.  Depending on the licensing of the related mod, features like PM attachments would naturally depend on either (1) the original mod author making the changes necessary to make their mod work with SMF 2.1 Beta x, or (2) a completely original version of the mod.....

Regarding your comment about built-in support, 2.1 is feature-locked and unlikely to have new features added to it.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 11, 2015, 09:31:18 AM
Uploaded v4.4 - September 11th, 2015
o Rewrote the code that puts the download counter and link underneath the inline attachment.
o Fixed issue where thumbnail image is still shown under post regardless of setting.
o Fixed issue where text under image is still shown under inline image regardless of setting.

Quote from: dougiefresh on September 09, 2015, 07:21:40 PM
Quote from: RSI on September 08, 2015, 02:07:05 PM
I got tired of waiting for v2.1 and the lack of this essential built-in feature along with a couple others.
Regarding your comment about built-in support, 2.1 is feature-locked and unlikely to have new features added to it.
Surprise, surprise....  A new topic was opened by CrescentEclipse: Inline multimedia (images/videos) (http://www.simplemachines.org/community/index.php?topic=539632.0) in the Feature Requests board....
Title: Re: Post and PM Inline Attachments
Post by: RSI on September 12, 2015, 01:14:23 PM
Quote from: dougiefresh on September 11, 2015, 09:31:18 AM
Surprise, surprise....  A new topic was opened by CrescentEclipse: Inline multimedia (images/videos) (http://www.simplemachines.org/community/index.php?topic=539632.0) in the Feature Requests board....

Except for they still don't get it. See the quote below...

"We don't have the resources to waste trying to make it into a gallery when that is better handled with a mod - since many people would have no use for a gallery when all they want is a forum."

It has nothing to do with galleries. I tried a galley mod my boards twice, one with phpBB3 and the other with SMF and nobody except for one or two people ever even used it. Having inline attachments has nothing to do with galleries though. It has to do with the presentation with how someone presents a post in a topic like when they are trying to explain something and maybe technically related. In my case it has to do with posting schematics and other related images where you are describing something without having the reader needing to search through all of the attachments at the bottom of the post trying to figure out what is what.

Anyway, not getting on that soapbox again because it's a waste of time.

Take care...
Title: Re: Post and PM Inline Attachments
Post by: brynn on September 20, 2015, 09:30:45 PM
Wow, up to version 4.4 now!

When I was giving previous feedback about SVG attachments, I never did try actually opening them.  And now that I have, it turns out they don't open when inline attachments is used.

But I'll install the newest version and try again.

Edit
Yes, installing the new version fixed it.  They can be opened now  :)
Title: Re: Post and PM Inline Attachments
Post by: brynn on September 30, 2015, 06:37:07 AM
However, even with the new version, anytime someone views a topic with an inline attachment, it throws an error.  It looks like one error for each attachments, although I haven't confirmed it (since I don't know exactly what to look for).

Shall I post or send you some error messages?  Or are you already aware?

I can't handle this many errors coming through.  As nice as this attachment is, I'll have to uninstall it if these errors can't be fixed.

Thanks  :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 02, 2015, 09:34:08 PM
Quote from: brynn on September 30, 2015, 06:37:07 AM
However, even with the new version, anytime someone views a topic with an inline attachment, it throws an error.  It looks like one error for each attachments, although I haven't confirmed it (since I don't know exactly what to look for).

Shall I post or send you some error messages?  Or are you already aware?
On my test forum (SMF 2.0.11), I am not getting any errors with only this mod installed.  Please post the error(s) so that I can research and try to fix them.
Title: Re: Post and PM Inline Attachments
Post by: brynn on October 03, 2015, 06:32:02 AM
Yes, I'll be glad to post some errors.  But I'm not sure what info you need.  Here, I just manually highlighted everything inside a single error.  Is that good for what you need?  Should I mask any info?  Once I'm sure what to post, I can give you more errors.

Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address 78.46.38.10 
     Reverse chronological order of list October 03, 2015, 03:14:17 AM
Apply Filter: Only show the error messages of this session a80a7a3f9b28765d3a6b9209b167cf8d
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URL
http://forum.inkscapecommunity.com/index.php?action=printpage;topic=220.0
Apply Filter: Only show the errors with the same message
8: Undefined offset: 1
Apply Filter: Only show the errors from this file
File: /home/brynn/public_html/forum/Sources/Subs-InlineAttachments.php
Line: 514
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 03, 2015, 07:55:25 AM
I need the following information.  (The rest of what you provided is irrelevant.  :P )
Quote from: brynn on October 03, 2015, 06:32:02 AM
http://forum.inkscapecommunity.com/index.php?action=printpage;topic=220.0
8: Undefined offset: 1
File: /home/brynn/public_html/forum/Sources/Subs-InlineAttachments.php
Line: 514

Btw, I rewrote the code to eliminate this particular bug report.  Any others?

EDIT: If you are having an issue with a specific post, please indicate which one so that I can look at that specific post and see if I can figure out how to eliminate that problem....
Title: Re: Post and PM Inline Attachments
Post by: brynn on October 03, 2015, 10:37:36 AM
Ok, since I installed the latest version, the only errors are coming from that same topic.  Only that topic, always Line 514. 

Aand, all the attachments in that topic were made before I ever installed this mod.  But let me check my other forum.

Ok yeah, there are some more errors in the other forum.  However, that forum was converted to SMF from a phpBB forum.  And I didn't do the conversion myself, so I can't answer questions about how anything was handled.

Would you like to still have a look at those errors?  Or does the fact it was converted make it hard or impossible to track down the errors?
Title: Re: Post and PM Inline Attachments
Post by: brynn on October 03, 2015, 10:42:22 AM
Oh wait -- I haven't installed the current version in that forum yet.  So I'll do that, and I'll watch the next few days if there are more errors. 

Let me know if you can fix them or not, if the conversion makes it too hard, for some reason.

Thank you very much :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 03, 2015, 10:46:23 AM
Uploaded v4.5 - October 3rd, 2015
o Fixed undefined offset error within "fix param order" function.

Quote from: brynn on October 03, 2015, 10:37:36 AM
Ok, since I installed the latest version, the only errors are coming from that same topic.  Only that topic, always Line 514. 
Okay, cool!  That error has (hopefully) been taken care of....

Quote from: brynn on October 03, 2015, 10:37:36 AM
Would you like to still have a look at those errors?
Once you get the current version installed on that forum, send me the error messages that occur ONLY if they still occur with the latest version.  Thanks for the bug report!

Quote from: brynn on October 03, 2015, 10:37:36 AM
Or does the fact it was converted make it hard or impossible to track down the errors?
Maybe, maybe not....  Depends on what the errors are....
Title: Re: Post and PM Inline Attachments
Post by: svobodniy on October 03, 2015, 10:07:08 PM
SMF 2.0.11   +   Post_and_PM_Inline_Attachments_v4.5   (installed without errors)


Creating post:

(http://i.imgur.com/GmzCWqL.png)

After saving post:

(http://i.imgur.com/EIfSyb8.png)

No one {parameter}={value} is saving.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 04, 2015, 08:41:53 AM
I'll fix it when I get home today.  I'm work right now....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 04, 2015, 07:20:31 PM
Uploaded v4.6 - October 4th, 2015
o Fixed erroneous v4.5 update where ILA tag parameters were removed.

@svobodniy: I'm sorry about that.  I've been dealing with the passing of a relative....
Title: Re: Post and PM Inline Attachments
Post by: svobodniy on October 05, 2015, 12:09:27 AM
Quote from: dougiefresh on October 04, 2015, 07:20:31 PM
@svobodniy: I'm sorry about that.  I've been dealing with the passing of a relative....
Don't apologize. Thanks for the correction.

8)
Title: Re: Post and PM Inline Attachments
Post by: Yahmez on October 05, 2015, 10:11:51 PM
Hello!

I'm having an issue where if you try to preview a post with an inline attachment (before posting) it shows the attachment as:
[ You are not allowed to view attachments ]
It does seem to preview fine if you post it and edit it later then preview.
I am using version 4.6 of your mod and SMF 2.0.11 and it installed without errors.

Thanks for your help and the great mod.


Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 06, 2015, 03:56:24 AM
Quote from: Yahmez on October 05, 2015, 10:11:51 PM
Hello!

I'm having an issue where if you try to preview a post with an inline attachment (before posting) it shows the attachment as:
[ You are not allowed to view attachments ]
It does seem to preview fine if you post it and edit it later then preview.
I am using version 4.6 of your mod and SMF 2.0.11 and it installed without errors.
This is a known issue and hasn't been fixed yet.
Title: Re: Post and PM Inline Attachments
Post by: Yahmez on October 06, 2015, 06:49:11 AM
Quote from: dougiefresh on October 06, 2015, 03:56:24 AM
This is a known issue and hasn't been fixed yet.

Ahh, my bad. I should have read a few pages back, I would have seen that.
Title: Re: Post and PM Inline Attachments
Post by: brynn on October 07, 2015, 02:20:18 PM
Does 4.6 have the fix for the error I reported?  (the error that only came from 1 topic)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 07, 2015, 02:40:07 PM
Quote from: brynn on October 03, 2015, 10:37:36 AM
Ok, since I installed the latest version, the only errors are coming from that same topic.  Only that topic, always Line 514. 

Aand, all the attachments in that topic were made before I ever installed this mod.  But let me check my other forum.

Ok yeah, there are some more errors in the other forum.  However, that forum was converted to SMF from a phpBB forum.  And I didn't do the conversion myself, so I can't answer questions about how anything was handled.

Would you like to still have a look at those errors?  Or does the fact it was converted make it hard or impossible to track down the errors?
Quote from: brynn on October 07, 2015, 02:20:18 PM
Does 4.6 have the fix for the error I reported?  (the error that only came from 1 topic)
Since you didn't provide a link to the error in question, I'm going to assume you meant the one quoted above your question.  In this case, yes, version 4.6 fixes the error CORRECTLY.  Version 4.5 fixes the error, however, screws up the attachment tags.
Title: Re: Post and PM Inline Attachments
Post by: asmith on October 14, 2015, 04:22:00 AM
Hello,

Thank you for this mod!

For version 2.1, I found a few bugs. Hope you don't mind me pointing them out.

1.
In post.template.php, I think you've forgotten to change the foreach loop to include $attid. (It's popping up in my error log)

foreach ($context['current_attachments'] as $attachment)

to

foreach ($context['current_attachments'] as $attid =>  $attachment)

(the change is in 2.0.x version though)


2.
In Post.php (sources) there's this line:
ILA_Process_Quotes($_POST['message'], $msg_id);

Again $msg_id is not defined there. (happened after clicking on save button)

3.
After a post is submitted and you try to modify it, you CANNOT add anymore attachments there. Page reloads and attachments are untouched. I tried uninstalling your mod and SMF was working fine after that.

4. (suggestion)
Is it possible to show attachments when clicking on the "preview" button? OR in the editor, if you click on the view source button to disable it, you could see the result there?
I know that is not easy with the way SMF works. For example attachments must be uploaded the second they are selected by the user or if it is a new post, there's no msg ID available yet and SMF needs attachments to be assigned to a post. But I think this feature is essential. (some editors like Wordpress already have this feature, but they hold a user gallery for it to work)
Title: Re: Post and PM Inline Attachments
Post by: brynn on October 14, 2015, 04:21:38 PM
Hey dougifresh  :)

Still some errors with that topic.  I'm not sure what it is about that topic....  (maybe I should fix the topic?)   Anyway, here is some info on the errors (from the log):

http://forum.inkscapecommunity.com/index.php?topic=220.15;wap2
8: Undefined index:
File: /home/brynn/public_html/forum/Sources/Subs-InlineAttachments.php
Line: 513

http://forum.inkscapecommunity.com/index.php?topic=220.msg1490
8: Undefined index:
File: /home/brynn/public_html/forum/Sources/Subs-InlineAttachments.php
Line: 513

(identical to above, except msg 1475, 1482, 1484, 1489, 1498, 1499, 1508, 1511, 1515, maybe more)

http://forum.inkscapecommunity.com/index.php?topic=220.0
8: Undefined index:
File: /home/brynn/public_html/forum/Sources/Subs-InlineAttachments.php
Line: 513

http://forum.inkscapecommunity.com/index.php?action=printpage;topic=220.0
8: Undefined index:
File: /home/brynn/public_html/forum/Sources/Subs-InlineAttachments.php
Line: 513

Always that topic and always Line 513, for all of them.

Thanks, as always, and always much appreciation for your good and hard work  :laugh:
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 16, 2015, 10:42:40 AM
Quote from: asmith on October 14, 2015, 04:22:00 AM
For version 2.1, I found a few bugs. Hope you don't mind me pointing them out.
Please upgrade your mod to version 4.6, which is available on the mod download page.  A link can be found in the first post of this thread.  Thanks!

Quote from: asmith on October 14, 2015, 04:22:00 AM
4. (suggestion)
Is it possible to show attachments when clicking on the "preview" button? OR in the editor, if you click on the view source button to disable it, you could see the result there?
I know that is not easy with the way SMF works. For example attachments must be uploaded the second they are selected by the user or if it is a new post, there's no msg ID available yet and SMF needs attachments to be assigned to a post. But I think this feature is essential. (some editors like Wordpress already have this feature, but they hold a user gallery for it to work)
This is a known issue and hasn't been addressed yet.
Title: Re: Post and PM Inline Attachments
Post by: asmith on October 17, 2015, 02:12:47 AM
Quote from: dougiefresh on October 16, 2015, 10:42:40 AM
Please upgrade your mod to version 4.6, which is available on the mod download page.  A link can be found in the first post of this thread.  Thanks!

I have. All the bugs mentioned ARE in v4.6. (by 2.1 I meant SMF 2.1 beta 2)

For example, in file install_21.xml, line 261 that's where the first bug I mentioned is happening. All 3 bugs are happening in v4.6 in SMF 2.1 beta 2.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 17, 2015, 09:44:42 AM
Quote from: asmith on October 17, 2015, 02:12:47 AM
I have. All the bugs mentioned ARE in v4.6. (by 2.1 I meant SMF 2.1 beta 2)
My bad.  I assumed, for some reason, that you were running version 2.1 of the mod, not on SMF 2.1.....

Quote from: asmith on October 14, 2015, 04:22:00 AM
1.
In post.template.php, I think you've forgotten to change the foreach loop to include $attid. (It's popping up in my error log)

foreach ($context['current_attachments'] as $attachment)

to

foreach ($context['current_attachments'] as $attid =>  $attachment)

(the change is in 2.0.x version though)


2.
In Post.php (sources) there's this line:
ILA_Process_Quotes($_POST['message'], $msg_id);

Again $msg_id is not defined there. (happened after clicking on save button)
This has been solved for the next version.  Thanks for reporting them!

Quote from: brynn on October 14, 2015, 04:21:38 PM
http://forum.inkscapecommunity.com/index.php?action=printpage;topic=220.0
8: Undefined index:
File: /home/brynn/public_html/forum/Sources/Subs-InlineAttachments.php
Line: 513
The function has been fixed in the next version so that it hopefully won't happen again.  It would be nice to know what is triggering it, though....

I think the issue is at this message: http://forum.inkscapecommunity.com/index.php?topic=220.msg1490#msg1490 (http://forum.inkscapecommunity.com/index.php?topic=220.msg1490#msg1490).  Any chance you might send me the contents of that post, either publicly or via PM?  Thanks!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 17, 2015, 07:03:27 PM
Uploaded v4.7 - October 17th, 2015
o SMF 2.1: Fixed two undefined errors within install_21.xml.
o SMF 2.1: Fixed issue where additional attachments couldn't be added during post edit.
o Fixed several undefined errors within Subs-InlineAttachments.php.




@Everybody: I'm working long hours and haven't been able to answer questions in a timely manner.  This may go on for the next month or so.  Please be patient, as I don't even have time for myself, much less these mods....  Thanks for understand.

@asmith: Thank you for the bug reports!!!  I've fixed the reports you gave me....
Title: Re: Post and PM Inline Attachments
Post by: brynn on October 18, 2015, 08:06:14 AM
Quote from: dougiefresh on October 17, 2015, 07:03:27 PM
Uploaded v4.7 - October 17th, 2015
o SMF 2.1: Fixed two undefined errors within install_21.xml.
o SMF 2.1: Fixed issue where additional attachments couldn't be added during post edit.
o Fixed several undefined errors within Subs-InlineAttachments.php.




@Everybody: I'm working long hours and haven't been able to answer questions in a timely manner.  This may go on for the next month or so.  Please be patient, as I don't even have time for myself, much less these mods....  Thanks for understand.

No rush for me.  I'll install 4.7 and let you know re errors.

QuoteI think the issue is at this message: http://forum.inkscapecommunity.com/index.php?topic=220.msg1490#msg1490.  Any chance you might send me the contents of that post, either publicly or via PM?  Thanks!

Sure, I'll be glad to.  But not sure what you mean.  Can't you see the contents?  Maybe I need to fix a permission somewhere?  Or do you mean the attachmenets?
Title: QUICK question about Post and PM Inline Attachments
Post by: debiwebi on October 18, 2015, 11:29:44 AM
Hi Dougie, I have what I hope is a question with a quick/easy solution. I uninstalled the PPMIA mod a while ago, but I think I recently restored an old file that has some of the mod's alterations in it. The other day someone posted an image and the message box shows this: [attachment=1][/attachment].

Can you tell me what file I might have to take that bit of code out of? I've looked at Sources/Display.php and that seems back to it's original state, also looked at Themes/default/Display.template.php and that looked okay to me too. Is there another file I need to look at?

Thanks, I know you're busy...

Title: Re: Post and PM Inline Attachments
Post by: asmith on October 19, 2015, 10:10:39 AM
Quote from: dougiefresh on October 17, 2015, 07:03:27 PM
@asmith: Thank you for the bug reports!!!  I've fixed the reports you gave me....

No problem.

There's another bug which happens on both 2.0.x and 2.1.x. If attachments limit number is reached, by clicking "(insert attachment)" of the already attached files, it gives Javascript error "insertAttachment is not defined". (and obviously it won't insert the bb code)


Reason:
In post.template.php, around line 470, there's this if statement which is printing SMF's original addAttachment function script:

if ($context['num_allowed_attachments'] > 1)

If attachments are full. For example 4 attachments per post is the limit and the user already has 3 attachments (or 4), that if statement won't echo, therefore your function insertAttachment(id) won't be echoed as well. (which is a shame, because you need to echo that function separately hehe)
Title: Re: Post and PM Inline Attachments
Post by: debiwebi on October 22, 2015, 04:14:57 PM
Dougie, update: The problem only happened the one time, so it's no longer a problem.
I'd update my post above, but my editing time expired long ago.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 24, 2015, 09:44:06 AM
Uploaded v4.8 - October 24th, 2015
o Fixed issue where Javascript not inserted when no or only one more attachment is allowed in post.



Quote from: asmith on October 19, 2015, 10:10:39 AM
In post.template.php, around line 470, there's this if statement which is printing SMF's original addAttachment function script:

if ($context['num_allowed_attachments'] > 1)

If attachments are full. For example 4 attachments per post is the limit and the user already has 3 attachments (or 4), that if statement won't echo, therefore your function insertAttachment(id) won't be echoed as well. (which is a shame, because you need to echo that function separately hehe)
@asmith: Sorry about breaking the mod like that.  I fixed the issue that you mentioned....  Regarding the post contents request, I finally got logged back into the Inkscape forum and saw the post in question.  I can't fathom why that particular post might be kicking up error messages, since it doesn't have any of the inline attachment tags within it.

Quote from: debiwebi on October 18, 2015, 11:29:44 AM
Hi Dougie, I have what I hope is a question with a quick/easy solution. I uninstalled the PPMIA mod a while ago, but I think I recently restored an old file that has some of the mod's alterations in it. The other day someone posted an image and the message box shows this: [attachment=1][/attachment].

Can you tell me what file I might have to take that bit of code out of? I've looked at Sources/Display.php and that seems back to it's original state, also looked at Themes/default/Display.template.php and that looked okay to me too. Is there another file I need to look at?
@debiwebi: That code actually takes place in the Themes/default/Post.template.php (and other related Post.template.php files)....  It's in the Javascript function called insertAttachment.
Title: Re: Post and PM Inline Attachments
Post by: asmith on October 25, 2015, 02:27:54 AM
dougiefresh,

In SMF 2.1, it got broke. One syntax error and one duplicated function.

install_21x.xml, line 227, you forgot to remove this function. (So it is getting duplicated)

install_21x.xml, line 238, there's single-quote and semi-column which needs to be removed. It's causing syntax error.


Quote from: dougiefresh on October 24, 2015, 09:44:06 AM
@asmith: ....  Regarding the post contents request, I finally got logged back into the Inkscape forum and saw the post in question.  I can't fathom why that particular post might be kicking up error messages, since it doesn't have any of the inline attachment tags within it.


I don't think that was aimed at me? I don't know what is that xD
Title: Re: Post and PM Inline Attachments
Post by: brynn on October 27, 2015, 07:10:37 AM
Quote from: asmith on October 25, 2015, 02:27:54 AM
......

Quote from: dougiefresh on October 24, 2015, 09:44:06 AM
@asmith: ....  Regarding the post contents request, I finally got logged back into the Inkscape forum and saw the post in question.  I can't fathom why that particular post might be kicking up error messages, since it doesn't have any of the inline attachment tags within it.


I don't think that was aimed at me? I don't know what is that xD

Yeah, I think that was for me. 

That's correct.  All those attachments were made before I ever installed this mod.  I was curious about that myself, but I'm not a programmer.

However, the good news is that error has not appeared, since installing 0.47!

Unfortunately, I now have some errors from personal messages:

http://forum.inkscapecommunity.com/index.php?action=pm;sa=send;f=inbox;pmsg=273;u=2
8: Undefined variable: sourcedir
File: /home/brynn/public_html/forum/Themes/default/PersonalMessage.template.php
Line: 1637

http://forum.inkscapecommunity.com/index.php?action=pm;sa=send;f=inbox;pmsg=273;u=2
8: Undefined index: current_attachments
File: /home/brynn/public_html/forum/Themes/default/PersonalMessage.template.php
Line: 1620

http://forum.inkscapecommunity.com/index.php?action=pm;sa=send;f=inbox;pmsg=272;u=all
8: Undefined variable: sourcedir
File: /home/brynn/public_html/forum/Themes/default/PersonalMessage.template.php
Line: 1637

http://forum.inkscapecommunity.com/index.php?action=pm;sa=send;f=inbox;pmsg=272;u=all
8: Undefined index: current_attachments
File: /home/brynn/public_html/forum/Themes/default/PersonalMessage.template.php
Line: 1620

http://forum.inkscapecommunity.com/index.php?action=pm;sa=send2
8: Undefined variable: sourcedir
File: /home/brynn/public_html/forum/Themes/default/PersonalMessage.template.php
Line: 1637

http://forum.inkscapecommunity.com/index.php?action=pm;sa=send;f=inbox;pmsg=269;quote;u=1
8: Undefined variable: sourcedir
File: /home/brynn/public_html/forum/Themes/default/PersonalMessage.template.php
Line: 1637

http://forum.inkscapecommunity.com/index.php?action=pm;sa=send;f=inbox;pmsg=269;quote;u=1
8: Undefined index: current_attachments
File: /home/brynn/public_html/forum/Themes/default/PersonalMessage.template.php
Line: 1620

And there are several more, but they all refer to lines 1620 and 1637
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 27, 2015, 10:17:00 AM
@brynn: Can you send me your Themes/default/PersonalMessage.template.php?  I'm installing the mod on a clean SMF 2.1 Beta 2 copy, and after installation, I'm not finding any occurrences of either $sourcedir or $current_attachments in that file....

@asmith: Thank you for the reports.  I've got another version ready that addresses these reports, however, I'm going to hold off until I get brynn's bug reports taken care of...
Title: Re: Post and PM Inline Attachments
Post by: BellGab.com on October 28, 2015, 03:05:02 AM
Quote from: dougiefresh on October 27, 2015, 10:17:00 AM
I've got another version ready that addresses these reports, however, I'm going to hold off until I get brynn's bug reports taken care of...

thanks for working on this.
Title: Re: Post and PM Inline Attachments
Post by: brynn on October 30, 2015, 06:22:04 AM
Ok, there's 2 of those files, one has ~ on the end.  Does it matter which one I attach?

Edit
Well, they look identical, afaict.  So it's attached.
Title: Re: Post and PM Inline Attachments
Post by: hannes_kann_es on October 30, 2015, 02:48:53 PM
Hey,

when checking "Allow quoted attachment images from another post?", inline attachments will break the Tapatalk-Plugin. Tapatalk users will get an error message that Display() cannot be duplicated in Display.php from tapatalk. Any fix from your side or should I post this on tapatalk-forums?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 31, 2015, 09:06:24 AM
Uploaded v4.9 - October 30th, 2015
o Fixed double Javascript function declaration issue, found by asmith.
o Fixed undefined index error where apparently no attachments were available for the post.
o Fixed undefined variable error that detects whether SCEditor is installed.
o SMF 2.1: Fixed code-breaking syntax error that was found by asmith.




@brynn and @asmith: This update should solve the problems you reported.  Thank you for the reports!

Quote from: hannes_kann_es on October 30, 2015, 02:48:53 PM
when checking "Allow quoted attachment images from another post?", inline attachments will break the Tapatalk-Plugin. Tapatalk users will get an error message that Display() cannot be duplicated in Display.php from tapatalk. Any fix from your side or should I post this on tapatalk-forums?
I have no idea why that option should conflict with anything from the Tapatalk plugin.....
Title: Re: Post and PM Inline Attachments
Post by: hannes_kann_es on October 31, 2015, 05:20:29 PM
@dougiefresh: disabling the option makes Tapatalk work again. Otherwise every page with attachments can't be loaded inside the app.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 31, 2015, 07:12:47 PM
@hannes_kann_es: I have no idea why it should make any sort of difference, since the option is handled within the Subs-InlineAttachments.php file.....  Can you attach your copy of Sources/Display.php?  Maybe there is something different within your Display.php file....  I don't know....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 31, 2015, 07:35:48 PM
Quote from: hannes_kann_es on October 30, 2015, 02:48:53 PM
Any fix from your side or should I post this on tapatalk-forums?
Posting about it on the tapatalk forums wouldn't hurt....  Please let me know what you find out.  Meanwhile, I guess I'm going to have do some digging into the Tapatalk plugin for SMF and see if I can figure out what is happening.....
Title: Re: Post and PM Inline Attachments
Post by: brynn on November 02, 2015, 04:34:11 AM
Hi dougiefresh or anyone who knows the answer  :)

The option "Remove attachment image under post after in-post use" -- what does that mean?  What is "in-post use"?

Thanks!
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on November 02, 2015, 09:22:05 AM
Quote from: brynn on November 02, 2015, 04:34:11 AM
Hi dougiefresh or anyone who knows the answer  :)

The option "Remove attachment image under post after in-post use" -- what does that mean?  What is "in-post use"?

Thanks!

It means if that option is checked, you can hide the attachments shown below the actual post, leaving the "inserted" attachments where you have chosen..

Hope that makes sense!  O:)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 02, 2015, 05:44:53 PM
Quote from: hannes_kann_es on October 30, 2015, 02:48:53 PM
when checking "Allow quoted attachment images from another post?", inline attachments will break the Tapatalk-Plugin. Tapatalk users will get an error message that Display() cannot be duplicated in Display.php from tapatalk. Any fix from your side or should I post this on tapatalk-forums?
What I can do about this is to disable that particular option within the code so that it doesn't break Tapatalk when Tapatalk is detected on the system....  At least until a better solution is found....  I'm trying to write something at the moment to fix this....

Quote from: brynn on November 02, 2015, 04:34:11 AM
The option "Remove attachment image under post after in-post use" -- what does that mean?  What is "in-post use"?
420Connect.co.uk is correct.  I'm also trying to add some inline help stuff to the mod to make it easier to understand....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 06, 2015, 09:02:44 AM
Uploaded v4.10 - November 5th, 2015
o "Allow quoted attachments from another post" is ignored if Tapatalk mod is detected.
o "Allow quoted attachments from another post" is now unchecked and disabled when Tapatalk mod is detected.
o Modified ILA admin area so that video options are disabled if embedding video option is not checked.
o Added help strings to the ILA admin area to attempt to clearly define what the options do.
o Added Javascript validation functions to the ILA admin area so that invalid data cannot be entered.
o Fixed issue with scaling ILA option where maximum image size was used instead all the time.




@hannes_kann_es:  Thanks for the bug report!  Hopefully, this update solves the issue for you.  Please note that this update disables that option when the Tapatalk plugin is detected.
Title: Re: Post and PM Inline Attachments
Post by: brynn on November 10, 2015, 01:36:00 AM
Thanks  420Connect.co.uk :)  Maybe if instead of "in-post use" is says "inline use".  I think I would have figured that out. 

(edit #2 -- Seems like having the attachment under the message should not even be possible, if the attachment is inline.  Why would anyone need the attachment twice in the same message?)

With version 4.9 I'm still having some errors in PMs.  (edit #1 -- I never attached anything, and changed my mind, and never sent the message.  But errors came anyway.)

http://forum.inkscapecommunity.com/index.php?action=pm;sa=send
8: Undefined index: ila_insert
File: /home/brynn/public_html/forum/Themes/default/PersonalMessage.template.php
Line: 1628

http://forum.inkscapecommunity.com/index.php?action=pm;sa=send
8: Undefined index: ila_insert
File: /home/brynn/public_html/forum/Themes/default/PersonalMessage.template.php
Line: 1612
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on November 10, 2015, 04:56:34 AM
Catching up on the issues reported here and wondering if the mod is also causing some conflicts with tapatalk as previously suggested, as I too experience a few error messages and broken topics when trying to view them in tapatalk, ones including attachments might just be it! I'll have a play around and report back my findings
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on November 10, 2015, 07:49:00 AM
Hmm..

I've just getting around to testing out the replacing of 0 to 1-based numbering after installing the latest version and get hit with

Hacking attempt...

when I click on Save  :o

From error log:

File: .../Sources/Subs-InlineAttachmentsAdmin.php
Line: 254
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 10, 2015, 03:40:51 PM
Quote from: brynn on November 10, 2015, 01:36:00 AM
(edit #2 -- Seems like having the attachment under the message should not even be possible, if the attachment is inline.  Why would anyone need the attachment twice in the same message?)
That is my thinking, too, which is why attachments aren't shown again at the bottom of the post by default.  However, someone might want to allow people to download the original image, for whatever purpose, and this option allows them to do so easily....

Quote from: brynn on November 10, 2015, 01:36:00 AM
With version 4.9 I'm still having some errors in PMs.  (edit #1 -- I never attached anything, and changed my mind, and never sent the message.  But errors came anyway.)
@brynn: I've fixed the error messages that you reported.  It turns out that the language file wasn't being loaded.  :(

Quote from: 420Connect.co.uk on November 10, 2015, 07:49:00 AM
I've just getting around to testing out the replacing of 0 to 1-based numbering after installing the latest version and get hit with

Hacking attempt...
@420Connect.co.uk: Huh.... That's one interesting bug report you've got there....  Let me investigate it.

EDIT: I have a feeling that the CONTENTS of the message being processed is responsible for tripping the "hacking attempt" message.....  Looks like a rewrite is necessary....  :o
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 10, 2015, 05:32:18 PM
Uploaded v4.11 - November 10th, 2015
o Fixed undefined index error in PersonalMessage.template.php, reported by brynn.
o Modified renumbering function to avoid "hacking attempt" error message, reported by 420Connect.co.uk.




@brynn and @420Connect.co.uk:  Thank you for the bug reports!
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on November 11, 2015, 12:42:51 PM
Many thanks for the quick fix dougie but I think something strange is still happening..
I can now save without the hacking attempt message, but I think it has possibly renumbered them, 1 number too high?..
e.g: 0 became 2

I'm getting a bit confused about the numbering of them now  :P
& just to confuse things a bit more.. - I'm using this mod (http://custom.simplemachines.org/mods/index.php?mod=2233) to offer my members a pre-formatted drop-down list version of: "[attachment id=0 msg=new]" ..as 'Insert First Attachment' and so on..

(I'm also not sure if I should change my numbering in that mods settings before or after the 1-based change..)

I'll make the coffee's..:P

Much appreciated if you can help untangle my mess  O:)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 11, 2015, 03:31:57 PM
(https://thedearsoandsoblog.files.wordpress.com/2014/07/facepalm.png)
I'm posting v4.11a with the ILA_Admin_Adjust function disabled in Subs-InlineAttachmentsAdmin.php file.  Attached is the Subs-InlineAttachmentsAdmin.php file.  Just upload it to your Sources folder and the function won't incorrectly modify the posts....

Quote from: 420Connect.co.uk on November 11, 2015, 12:42:51 PM
Much appreciated if you can help untangle my mess  O:)
:o OMG....  Looking at the code, I now understand WHY it happened.  I assume you had two references to inline attachments, like so:
[attach id=0 msg=blah]
[attach id=1 msg=blah]

The code incremented/decremented the first id (id=0) to 1.  When it went to increment the second id (id=1), it saw TWO copies, so it incremented/decremented BOTH copies.....  I can't undo this using code.  I hope you've made a recent database backup of your messages, so you can do a partial restore on the messages....  I'm so sorry!  :o
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 11, 2015, 03:36:03 PM
Uploaded v4.12 - November 11th, 2015
o Fixed the ILA_Admin_Adjust function so that it doesn't screw up posts with ILA tags.




@Everybody: Dcmouser has brought some bugs and fixes into the light, and I intend on incorporating the fixes into this mod.  The only unfortunate thing is that I'm not sure what version the file he sent me is based on, so it will take me a while to figure out what/where the changes are....
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on November 11, 2015, 04:23:16 PM
Quote from: dougiefresh on November 11, 2015, 03:31:57 PM
(https://thedearsoandsoblog.files.wordpress.com/2014/07/facepalm.png)
I'm posting v4.11a with the ILA_Admin_Adjust function disabled in Subs-InlineAttachmentsAdmin.php file.  Attached is the Subs-InlineAttachmentsAdmin.php file.  Just upload it to your Sources folder and the function won't incorrectly modify the posts....

Quote from: 420Connect.co.uk on November 11, 2015, 12:42:51 PM
Much appreciated if you can help untangle my mess  O:)
:o OMG....  Looking at the code, I now understand WHY it happened.  I assume you had two references to inline attachments, like so:
[attach id=0 msg=blah]
[attach id=1 msg=blah]

The code incremented/decremented the first id (id=0) to 1.  When it went to increment the second id (id=1), it saw TWO copies, so it incremented/decremented BOTH copies.....  I can't undo this using code.  I hope you've made a recent database backup of your messages, so you can do a partial restore on the messages....  I'm so sorry!  :o


I'm not sure if that top part was directed at me - should everyone do it or.. hang on for the next release with the other bug fix things?

& RE: my mess..
Unchecking the box restores them to working order thankfully but it's back to 0 as being the first attachment and so on..

As always, a million and one thanks for all your time and effort put into this mod, you are a true legend :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 11, 2015, 05:22:00 PM
@420Connect.co.uk: Well, I had uploaded v4.11a with the modified Subs-InlineAttachments.php file attached two posts back....  Then fixed it and uploaded v4.12....  The problem function has been fixed, but I can't unfix the damage that v4.11 did...
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on November 12, 2015, 11:19:52 AM
I see.. I think :P

Unchecking the 1-based box and hitting 'save' reverted my messages back to how they were so the attachments now work  :D - (so there was no 'damage' caused! :)), am I okay to go ahead and install the latest version instead? (v4.12)


e2a: .. Just tried out v4.12 and again, it seems to change 0 to 2, instead of 0 to 1.. ???
I can PM you an account if it's easier to see whats going on?

Thanks again!
Title: Re: Post and PM Inline Attachments
Post by: brynn on November 12, 2015, 10:03:58 PM
QuoteHowever, someone might want to allow people to download the original image, for whatever purpose, and this option allows them to do so easily....

I don't understand that.  I can download an image from an inline attachment, assuming I have the option for showing the download link enabled.  Hhmmm....even if I disable showing a download link, I can still download the image/file from inline attachment.

I'll get the current version and let you know about errors  :)

Edit
Wait....my current version is 4.9.  But the version available for download is 4.12.  Can that be correct?  Should be 5.12?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 13, 2015, 03:04:43 PM
Quote from: brynn on November 12, 2015, 10:03:58 PM
QuoteHowever, someone might want to allow people to download the original image, for whatever purpose, and this option allows them to do so easily....
I don't understand that.  I can download an image from an inline attachment, assuming I have the option for showing the download link enabled.  Hhmmm....even if I disable showing a download link, I can still download the image/file from inline attachment.
Well, I don't know how to phrase it any differently so that you understand.  I've forgotten why I added the option in the first place and I'm not going to remove it.  Use it or ignore it.  Either way, get over it.

Quote from: brynn on November 12, 2015, 10:03:58 PM
Wait....my current version is 4.9.  But the version available for download is 4.12.  Can that be correct?  Should be 5.12?
Nope.  Version 4.12 is the latest version as of this post.  Btw, why would it be 5.12 anyways?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 15, 2015, 09:27:41 AM
@420Connect.co.uk:  I can't reproduce the issue with mod version 4.12.  You can put the contents of the post you're having problems with in quotes so that I can see if I can reproduce the issue....  Or if you want, PM me with account info..... 
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 15, 2015, 11:30:03 AM
Uploaded v4.13 - November 15th, 2015
o Rewrote ILA admin page so that hopefully the ILA tags are modified correctly.
o Fixed potential issue with adjusting ILA tags with attachment IDs greater than 9.
o Made changes suggested by dcmouser to code using HighSlide for SMF (HS4SMF) mod.
o Added message during post preview to indicate attachment has not been uploaded yet.
o Adjusted admin page because some servers error on trying to retrieve latest mod version.
o Modified permission checking code so that the board permissions can be properly used.
o Fixed issue where global language variable was overwritten by ILA_Invalid_Tags function.
o Fixed a few typecasting issues found which caused a few problems on some servers.
o Fixed error message where array was passed instead of integer value in loop.




@Everybody:  Many of the modifications in this release are a result of my examination of dcmouser's modifications to my mod.  It unfortunately is a much older version of the mod (appears to be version 3.15), which complicates things.   :-*  Thank you, dcmouser!

@dcmouser:  All of your modifications haven't been included yet.  I'm still digging through the file in order to figure out what all you did....  Thank you!

@420Connect.co.uk: I see what your forum is doing, and I have no explanation for the WHY it is doing that....  Since I can't reproduce it on my localhost forum, I rewrote part of the ILA admin page to attempt to avoid double execution of the ILA_Admin_Adjust function.  Hopefully, this solves the issue here....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 15, 2015, 06:53:34 PM
UPDATE: I received a request for automatic modification of boilerplates and have implemented it.  It is undergoing some testing at the moment, but it will appear in the next version (whenever it comes out)....
Title: Re: Post and PM Inline Attachments
Post by: brynn on November 16, 2015, 03:57:08 AM
Quote from: dougiefresh on November 13, 2015, 03:04:43 PM
Quote from: brynn on November 12, 2015, 10:03:58 PM
QuoteHowever, someone might want to allow people to download the original image, for whatever purpose, and this option allows them to do so easily....
I don't understand that.  I can download an image from an inline attachment, assuming I have the option for showing the download link enabled.  Hhmmm....even if I disable showing a download link, I can still download the image/file from inline attachment.
Well, I don't know how to phrase it any differently so that you understand.  I've forgotten why I added the option in the first place and I'm not going to remove it.  Use it or ignore it.  Either way, get over it.

I apologize if I've done or said something wrong.

Quote
Quote from: brynn on November 12, 2015, 10:03:58 PM
Wait....my current version is 4.9.  But the version available for download is 4.12.  Can that be correct?  Should be 5.12?
Nope.  Version 4.12 is the latest version as of this post.  Btw, why would it be 5.12 anyways?

The various versions I've installed and tested, start with 3.17, and in order go up to 4.4, 4.6, 4.7, and 4.9.  I'm not very tech-savvy, and I've never seen versions of any software released with version numbers that go anything but upwards.  Based on that simple observation, I just thought it might have been a simple typographical error.  That's all.

Again, I apologize for whatever I did wrong.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 16, 2015, 07:31:25 AM
Quote from: brynn on November 16, 2015, 03:57:08 AM
Quote from: dougiefresh on November 13, 2015, 03:04:43 PM
Quote from: brynn on November 12, 2015, 10:03:58 PM
QuoteHowever, someone might want to allow people to download the original image, for whatever purpose, and this option allows them to do so easily....
I don't understand that.  I can download an image from an inline attachment, assuming I have the option for showing the download link enabled.  Hhmmm....even if I disable showing a download link, I can still download the image/file from inline attachment.
Well, I don't know how to phrase it any differently so that you understand.  I've forgotten why I added the option in the first place and I'm not going to remove it.  Use it or ignore it.  Either way, get over it.

I apologize if I've done or said something wrong.
No, you haven't done anything wrong.  I've been having a bad week at that point, so I apologize for the rudeness of my response.  I don't know why someone would want that option, seems redundant to me, but it's there if they do.  Yeah, I get that there are other ways to download the image, including right-click on the inline attachment image.  And I personally hate it when options I use disappear from either apps (personal experience with reflashing my phone with a different rom) or mods.... That's all I meant by that.  I'm sorry.

Quote from: brynn on November 16, 2015, 03:57:08 AM
Quote
Quote from: brynn on November 12, 2015, 10:03:58 PM
Wait....my current version is 4.9.  But the version available for download is 4.12.  Can that be correct?  Should be 5.12?
Nope.  Version 4.12 is the latest version as of this post.  Btw, why would it be 5.12 anyways?

The various versions I've installed and tested, start with 3.17, and in order go up to 4.4, 4.6, 4.7, and 4.9.  I'm not very tech-savvy, and I've never seen versions of any software released with version numbers that go anything but upwards.  Based on that simple observation, I just thought it might have been a simple typographical error.  That's all.

Again, I apologize for whatever I did wrong.
Oh, I understand now.  I've just been incrementing the minor version number (major.minor), unless something MAJOR occurs in the code that warrants upgrading to a whole new major version number.  It generally has to be something big, or a bunch of big and small changes....  But yeah, I see now where one might get confused by my version numbers....
Title: Re: Post and PM Inline Attachments
Post by: 420Connect.co.uk on November 16, 2015, 12:10:50 PM
Quote from: dougiefresh on November 15, 2015, 06:53:34 PM
UPDATE: I received a request for automatic modification of boilerplates and have implemented it.  It is undergoing some testing at the moment, but it will appear in the next version (whenever it comes out)....

Many thanks again for adding this in and I've found your other message and replied via PM! :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 21, 2015, 12:35:23 PM
Uploaded v4.14 - Movember 21st, 2015
o Added support for the "Boilerplates for Posts" mod to update ILA tags used.
o Modified ILA_Admin_Adjust to attempt to avoid incorrect of post messages.




@420connect.co.uk:  This update should solve the problems you reported.  Thank you for the bug reports and assistance!
Title: Re: Post and PM Inline Attachments
Post by: RSI on November 28, 2015, 05:04:56 PM
Are you guys still working on this mod? Two words; messy and cumbersome. It's more trouble that what it's worth.

Just switch to XenForo v1.5 and the problem is gone. It will fully import your SMF 2.x databases.

I see Arantor finally gave up on all of this nonsense back last April and disappeared. What does that tell you?

Nevertheless good luck...

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 28, 2015, 06:34:51 PM
Quote from: RSI on November 28, 2015, 05:04:56 PM
Are you guys still working on this mod?
Yes, it is still being developed.  Primarily me trying to fix bug reports as they come in.....

Quote from: RSI on November 28, 2015, 05:04:56 PM
Two words; messy and cumbersome.
:o How?  If you think you can do a better job, write your own mod.

Quote from: RSI on November 28, 2015, 05:04:56 PM
It's more trouble that what it's worth.
>:( Says who?  You?  I write mods for fun, not because you think it's not worth doing.  I also noticed that you've written exactly ZERO mods....  (or at least have ZERO mods published...  For all I know, you could have submitted a million mods, all of which have been rejected  :P )  I, on the other hand, have FORTY THREE mods published in the Customization area (my profile (http://custom.simplemachines.org/mods/index.php?action=profile;u=253913))

Quote from: RSI on November 28, 2015, 05:04:56 PM
Just switch to XenForo v1.5 and the problem is gone. It will fully import your SMF 2.x databases.
::) Yup, jumping from free software to something you have to pay annually is what everybody wants to do....

Quote from: RSI on November 28, 2015, 05:04:56 PM
I see Arantor finally gave up on all of this nonsense back last April and disappeared. What does that tell you?
O:) That Arantor is busy doing something else.....  Duh.

Quote from: RSI on November 28, 2015, 05:04:56 PM
Nevertheless good luck...
:o Um.... I'd say "thanks", but it really sounds more like a backhanded comment than an actual sincere statement....
Title: Re: Post and PM Inline Attachments
Post by: Colin on November 28, 2015, 11:46:10 PM
Quote from: RSI on November 28, 2015, 05:04:56 PM
Are you guys still working on this mod? Two words; messy and cumbersome. It's more trouble that what it's worth.

Just switch to XenForo v1.5 and the problem is gone. It will fully import your SMF 2.x databases.

I see Arantor finally gave up on all of this nonsense back last April and disappeared. What does that tell you?

Nevertheless good luck...

Dougie is a volunteer who works tirelessly to develop and support his modifications. You are welcome to suggest that the modification doesn't suit your purposes, but please be mindful about going too far and attacking the efforts of the mod's author. If you find specific issues with it why not report them? Dougie historically has responded to nearly every report and implemented reasonable changes to address them.

On behalf of the SMF Team and the community, thanks for what you do, Dougie.
Title: Re: Post and PM Inline Attachments
Post by: brynn on December 06, 2015, 10:55:32 PM
Quote from: Colin on November 28, 2015, 11:46:10 PM
On behalf of the SMF Team and the community, thanks for what you do, Dougie.

Ditto   :laugh:
Title: Re: Post and PM Inline Attachments
Post by: njtweb on December 07, 2015, 06:54:16 AM
Hey Dougie, love this mod. You helped me get it working on my site last year. I see you've made a few modifications. Should I upgrade? If I do will all of the current inline attachments be lost?

Thanks
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 08, 2015, 04:02:12 AM
Quote from: njtweb on December 07, 2015, 06:54:16 AM
Should I upgrade?
If you are experiencing issues with the mod, then yes, you definitely should upgrade.  There have been multiple bug fixes in the mod.  However, without knowing what version you have, it is hard to advise on whether you should or should not upgrade, just because....  :P  I've attached the changelog for mod version 4.14 to this post, so that you have some idea of what has happened.....

Quote from: njtweb on December 07, 2015, 06:54:16 AM
If I do will all of the current inline attachments be lost?
No, the current inline attachments are just tags that the bbcode parser processes.  The inline attachments that you are using are stored in the attachments table, and when the mod is uninstalled, the inline attachments will show up under the post as if they weren't inline anymore.  Once you install the new version, they will become inline again.
Title: Re: Post and PM Inline Attachments
Post by: njtweb on December 08, 2015, 06:35:01 AM
No, no problems at all. Here's what I got.

SMF 2.0.10
Post and PM Inline Attachments   3.8

Thanks
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 08, 2015, 07:51:09 PM
If I was you, I would upgrade the forum software to 2.0.11, and the mod to the current version, which I believe is v4.14....  (I worked over 12 hours today and am tired....)
Title: Re: Post and PM Inline Attachments
Post by: asmith on December 18, 2015, 04:17:57 AM
Hello dougiefresh!

There's a bug for SMF 2.1 beta 2, using v4.14.

If you are using the WYSIWYG editor (sceditor since SMF 2.1), clicking on "(insert attachment 1)", doesn't insert anything. It could insert something just to let the user know it has been inserted. But it doesn't do anything like nothing has been clicked. (so the user have to swich to BBC and insert it there and then again switch back to WYSIWYG)
Title: Re: Post and PM Inline Attachments
Post by: ZamaTata on December 18, 2015, 06:45:40 AM
Quote from: dougiefresh on November 28, 2015, 06:34:51 PM

Quote from: RSI on November 28, 2015, 05:04:56 PM
It's more trouble that what it's worth.
>:( Says who?  You?  I write mods for fun, not because you think it's not worth doing.  I also noticed that you've written exactly ZERO mods....  (or at least have ZERO mods published...  For all I know, you could have submitted a million mods, all of which have been rejected  :P )  I, on the other hand, have FORTY THREE mods published in the Customization area (my profile (http://custom.simplemachines.org/mods/index.php?action=profile;u=253913))

Quote from: RSI on November 28, 2015, 05:04:56 PM
Just switch to XenForo v1.5 and the problem is gone. It will fully import your SMF 2.x databases.
::) Yup, jumping from free software to something you have to pay annually is what everybody wants to do....



I think this guy is working on commission.. first he says your mod is messy and then straight away discard the whole forum.. I wonder why he is posting in the forum, he should be using his (I have never heard of until today) forum.. I am sure he is one of them.. because there better paid forums than his xboro forum like vBulletin..

If you can not make any contribution to a project at least have the decency to appreciate the efforts of those who are atleast doing something.. in this case with 42 mods you gotta be kidding me .

thanks Dougie I use few of your Mods..
Title: Re: Post and PM Inline Attachments
Post by: njtweb on December 18, 2015, 07:51:22 AM
LOL, Troll trying to get us to change from SMF to subscription based bulletin board. When I need something customized I pay the awesome members here to develop them for me, and they always work as promised.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 18, 2015, 05:22:19 PM
I appreciate y'all telling me this!  It gives me reason to help more....  Especially in the spirit of the season!  :P
Title: Re: Post and PM Inline Attachments
Post by: aegersz on January 09, 2016, 02:25:43 AM
hi, i am confused by this mod - i can show BBCode IMGs on PMs but how do i attach something to a PM in the first place ?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 09, 2016, 08:31:55 AM
You need to install PM Attachments (http://custom.simplemachines.org/mods/index.php?mod=1974) before this mod....

Huh, I need to fix that.  You shouldn't see that if the PM attachments mod isn't installed....
Title: Re: Post and PM Inline Attachments
Post by: aegersz on January 09, 2016, 09:42:58 AM
thanks. PM Attachments, I tried but the mod won't go on.

thanks again.
Title: Re: Post and PM Inline Attachments
Post by: njtweb on January 09, 2016, 02:10:12 PM
Quote from: aegersz on January 09, 2016, 09:42:58 AM
thanks. PM Attachments, I tried but the mod won't go on.

thanks again.

Change the version of SMF to the version the MOD supports then try to reinstall the mod.
Title: Re: Post and PM Inline Attachments
Post by: aegersz on January 10, 2016, 06:59:38 PM
I havent tried that but I get 2 failures in Sources/PersonalMessages.php (or close to that)

one is an alignment issue but the other failure is searching for a bit of code that isn't there.

I really want this mod on, too.

I may have to take all my PM mods off first and try again.
Title: Re: Post and PM Inline Attachments
Post by: aegersz on January 11, 2016, 01:47:05 AM
Finally installed it and it all works.

fyi: "PM Settings" mod removed ... (http://custom.simplemachines.org/mods/index.php?mod=3823) caused all the hassles so it needed removing.

all good.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 19, 2016, 06:56:10 AM
I just installed both this mod and the PM Settings (http://custom.simplemachines.org/mods/index.php?mod=3823) mod on a clean forum and they install nicely together, so I'm not understanding why you are seeing conflicts there (unless you meant to post in the Enhanced PM System (http://custom.simplemachines.org/mods/index.php?mod=3736) mod, which offers the same features and/or functionality as the PM Settings (http://custom.simplemachines.org/mods/index.php?mod=3823) mod....)
Title: Re: Post and PM Inline Attachments
Post by: aegersz on January 25, 2016, 02:32:39 AM
Quote from: dougiefresh on January 19, 2016, 06:56:10 AM
I just installed both this mod and the PM Settings (http://custom.simplemachines.org/mods/index.php?mod=3823) mod on a clean forum and they install nicely together, so I'm not understanding why you are seeing conflicts there (unless you meant to post in the Enhanced PM System (http://custom.simplemachines.org/mods/index.php?mod=3736) mod, which offers the same features and/or functionality as the PM Settings (http://custom.simplemachines.org/mods/index.php?mod=3823) mod....)

yes, i meant the coexistence with the Enhanced PM System ... my mistake, sorry.

your mod is fine.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 25, 2016, 04:41:10 PM
Quote from: aegersz on January 25, 2016, 02:32:39 AM
yes, i meant the coexistence with the Enhanced PM System ... my mistake, sorry.
Okay!  Thanks for clearing that up!
Title: Re: Post and PM Inline Attachments
Post by: Yahmez on February 03, 2016, 09:26:26 PM
Hi dougiefresh!
Thanks for all your hard work on this mod.

I have a question about using it with simpleportal...
When I add a forum post as an article for display on the front page, all images that are inserted using ILA are shown as:

[ You are not allowed to view attachments ]

I see this has been brought up once in this thread but was unresolved. This happens to images that have been uploaded and are showing just fine in the post but not in the article block. Any input is appreciated. Thanks!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 04, 2016, 11:35:32 AM
I'll look into he bug report once I am mobile enough to get to the computer.  I am recovering from knee surgery...
Title: Re: Post and PM Inline Attachments
Post by: Yahmez on February 04, 2016, 11:59:32 AM
Quote from: dougiefresh on February 04, 2016, 11:35:32 AM
I'll look into he bug report once I am mobile enough to get to the computer.  I am recovering from knee surgery...

Ah, that's no fun. I hope you are on the mend and feeling back to good soon. Take care of yourself.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 23, 2016, 03:14:31 PM
@brynn: I'd like to point you to my SVG As Image Attachments Support (http://www.xptsp.com/board/index.php?topic=658.0) mod, since you requested the mod be made a while ago....
Title: Re: Post and PM Inline Attachments
Post by: willerby on March 13, 2016, 02:00:03 PM
Hi Dougie, great mod. 99% of the time my users just want to add photos to posts and after poor experiences with ImageShack (and generally all external hosting services), I'd love to offer this function on my forum, storing the files on my server rather than leaving them to others.

Could I suggest an improvement for all the dumb users around?   I have many  :o

1) Change the SMF icon for 'Insert Image' so that it gives members two options:

    a) Enter Image Location... http:// (as now for selecting from an external hosting site or web page)
    b) Browse your computer... have the Browse button below this in the same window, just like it is for attachments

2) When using the Browse button and an image file is selected from their computer, use the Inline Attachments mod and the existing SMF code for uploading attachments to insert the BBC [ attachment = 1 ] etc, directly into the post where they have placed their cursor.

Hopefully the knee is better. Appreciate this is a big ask but the user experience would be so much better. Really should be a feature of SMF rather than mod  ;)

Just an idea...

W

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 13, 2016, 08:38:39 PM
Quote from: laetabi on March 13, 2016, 02:00:03 PM
Could I suggest an improvement for all the dumb users around?   I have many  :o

1) Change the SMF icon for 'Insert Image' so that it gives members two options:

    a) Enter Image Location... http:// (as now for selecting from an external hosting site or web page)
    b) Browse your computer... have the Browse button below this in the same window, just like it is for attachments

2) When using the Browse button and an image file is selected from their computer, use the Inline Attachments mod and the existing SMF code for uploading attachments to insert the BBC [ attachment = 1 ] etc, directly into the post where they have placed their cursor.
Let me see what I can do.  It'll probably be a while, since I'm working a bunch of hours at my job again. 

Regarding 1a, I believe that at least 2 mods already exist for this and/or similar functionality: Search for "image popup" (http://custom.simplemachines.org/mods/index.php?action=search;basic_search=image+popup)...  O:)

Quote from: laetabi on March 13, 2016, 02:00:03 PM
Hopefully the knee is better. Appreciate this is a big ask but the user experience would be so much better. Really should be a feature of SMF rather than mod  ;)
Thank you!  My knee is much better, but I'm walking A LOT and am very sore from all the walking...  I agree that this functionality should be a default feature, but I don't think many other forums support it natively, either....
Title: Re: Post and PM Inline Attachments
Post by: JerzyLS on March 14, 2016, 03:53:34 PM
How to remove an a href on an attachment?
I mean redirecting to the blank with attach on clicking.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 16, 2016, 08:39:45 PM
Quote from: JerzyLS on March 14, 2016, 03:53:34 PM
How to remove an a href on an attachment?
I mean redirecting to the blank with attach on clicking.
I'm sorry.  I don't understand what you are asking....
Title: Re: Post and PM Inline Attachments
Post by: JerzyLS on April 12, 2016, 01:18:35 PM
Nevermind.

Not working in PM's for me.
I see [ Attachment ] only.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 12, 2016, 07:10:38 PM
Quote from: JerzyLS on April 12, 2016, 01:18:35 PM
Nevermind.

Not working in PM's for me.
I see [ Attachment ] only.
I'll see what I can do.
Title: Re: Post and PM Inline Attachments
Post by: -Rock Lee- on April 13, 2016, 12:10:06 PM
I remain a doubt in the word "Count" Although concerning what this mod interpret it as "description" itself ... do not know if that was the idea but I think also good to have translated this -O.o I think I need a vacation to clear the mind hahah- I'll just let me say anything @dougiefresh :D


Regards!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 15, 2016, 10:01:37 AM
Uploaded v4.15 - April 15th, 2016
o Added Spanish Latin translation by Rock Lee [BC] (http://www.simplemachines.org/community/index.php?action=profile;u=322597).




@Rock Lee [BC]: Thank you for the translation.  There is also a XML file called language_english.xml that needs translating....

@Everybody:  This mod will be getting an overhaul in the near future, in order to address some flaws that dcmouser has already rewrote the code to address.  I just haven't had a good opportunity to incorporate (or understand) them.....
Title: Re: Post and PM Inline Attachments
Post by: -Rock Lee- on April 15, 2016, 11:59:20 AM
Quote from: dougiefresh on April 15, 2016, 10:01:37 AM
@Rock Lee [BC]: Thank you for the translation.  There is also a XML file called language_english.xml that needs translating....

@dougiefresh Oh apology had not seen why not translated now I looked more closely and you attached!


Regards!

Edit: Try to translate best parts do not quite understand well just leave them however, also used in that way (I doubt that I try to make it as neutral as possible) ... Anything let me know :-[
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 15, 2016, 12:58:41 PM
I've added the XML files you provided, then reuploaded the changed mod.  Thanks!
Title: Re: Post and PM Inline Attachments
Post by: Grammy on May 07, 2016, 04:22:33 PM
I have default, SMF 2.0.11. 

My problem:  The "Insert Attachment 1" link next to the image I browse to does not respond to a click.  I just see "Javascript:void (0);" when I hover over it.  When I click "Post", the image will upload (just as it does here) but it appears beneath the message area (as attachments usually do) instead of within the message area.  (Please see attached screenshot.)

My mods are

1.) Image Floating to Left or Right BBCode
2.) Member Notepad
3.) SMF Gallery Lite
4.) Ohara YouTube Embed
5.) Ultimate Profile
6.) Tabbed smileys
7.) cbi 1.0 (Custom Board Icons)
8.) SMF Arcade
9.) SMF Articles
10.) Dynamic_Memberlist
11.)Post and PM Inline Attachments

All were installed with the package manager and all installed cleanly.  There are no forum errors.

The only thing of note is that when I did uninstall this mod through the package manager, afterward, I found a forum error stating that InlineAttachments.english.php couldn't be loaded.  This only appeared following the uninstallation; there were no errors before my decision to uninstall.  I had to remove that language file manually.  I've reinstalled it, again without errors, but as before, the link next to the browse field doesn't respond to a click and does not place the attachment BBC code into the message area.

Is this something you could help me with?   Thanks so much.
Title: Re: Post and PM Inline Attachments
Post by: leemg on May 08, 2016, 02:39:58 AM
Quote
I just see "Javascript:void (0);" when I hover over it

ditto, same here.  :-\
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 08, 2016, 06:29:38 PM
Let me see what I can do....  I'm sure it'll be one of the many things I fix in the next release....  :(
Quote from: dougiefresh on April 15, 2016, 10:01:37 AM
@Everybody:  This mod will be getting an overhaul in the near future, in order to address some flaws that dcmouser has already rewrote the code to address.  I just haven't had a good opportunity to incorporate (or understand) them.....
Title: Re: Post and PM Inline Attachments
Post by: Grammy on May 08, 2016, 10:25:40 PM
Quote from: dougiefresh on May 08, 2016, 06:29:38 PM
Let me see what I can do....  I'm sure it'll be one of the many things I fix in the next release....  :(



I can uninstall temporarily and wait for the new release.  Thanks so much; I can see it's a great mod, barring this one issue, which I'm sure you'll be able to sort.  I really appreciate your efforts!   :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on May 09, 2016, 11:44:06 AM
My life has been quite busy since my return to full duty after my knee surgery.  I haven't started on the next release yet...  Sorry.
Title: Re: Post and PM Inline Attachments
Post by: Grammy on May 09, 2016, 02:17:39 PM
Quote from: dougiefresh on May 09, 2016, 11:44:06 AM
My life has been quite busy since my return to full duty after my knee surgery.  I haven't started on the next release yet...  Sorry.

Oh, that's very understandable!  We all need to remember that there's a real life outside the confines of these forums and that our mod authors actually have to cope with it the way we do.   :D

No worries and hope you're recovering well. 
Title: Re: Post and PM Inline Attachments
Post by: svendsen on June 25, 2016, 10:30:04 AM
First of all, I will thank you for a great mod you have made, and put in alot of time in.

My problem is that I when I try to open a subject with Tapatalk, it wont load. This is just happening to subjects where the BB codes from your mod have been used.

Is there a work around this, as I can't remove the tapatalk function at this time, we have a lot of mobile users.
And with your mod, we are hoping to stop the Facebook leak we have been seeing for years now.

There is also a size issue. I had to mod the code, so that no pic would be shown bigger then 800x600. This would have been nice if I could controll trough the controll center. I do not like going in and changing others work. I have made enough code, that I try my best to respect others work.

Hope you can help med with the Tapatalk problem or guide me.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 12, 2016, 07:12:20 PM
Haven't forgotten about y'all, just been REALLY busy with work and a few other projects....

@svendsen: Sorry, but at this time, this mod does not work with Tapatalk....  I don't know if I will be able to make it compatible with Tapatalk, either.
Title: Re: Post and PM Inline Attachments
Post by: Grammy on July 12, 2016, 07:13:16 PM
Quote from: dougiefresh on July 12, 2016, 07:12:20 PM
Haven't forgotten about y'all, just been REALLY busy with work and a few other projects....


You remind me of that guy I used to see on the Ed Sullivan Show when I was little.  He ran around spinning plates on these poles.

Slow down, Dougie, no worries.   :)
Title: Re: Post and PM Inline Attachments
Post by: timidapsin on July 13, 2016, 08:38:54 PM
Quote from: dougiefresh on July 12, 2016, 07:12:20 PM
Haven't forgotten about y'all, just been REALLY busy with work and a few other projects....

@svendsen: Sorry, but at this time, this mod does not work with Tapatalk....  I don't know if I will be able to make it compatible with Tapatalk, either.
Okay bro, i will keep on checking till you have time to fix it. God bless you :)
Title: Re: Post and PM Inline Attachments
Post by: timidapsin on July 14, 2016, 09:25:44 AM
Hello anyone here, please i need help..
When a user clicks insert attachment 1, it insert's [attachment id=1 msg=new] into  the post box, is it possible to make it insert something like
[attachment=1] or [attachment=1][/attachment] instead.
please i need a reply from anyone  :-[ , thank you
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 20, 2016, 06:22:02 PM
About a month ago, I've lost my job and have been severely depressed.  I need some help, so if you want to help, please do so!

I've uploaded this mod to GitHub here: https://github.com/douglasorend/Post_and_PM_Inline_Attachments
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on September 26, 2016, 06:01:35 AM
I'd like to install this mod, however up to now I've been working with ILA - InLine Attachments (the old one). I was just wondering, what would happen with my old attachments in the posts?

@dougiefresh: hope you're feeling better by now mate... we've all been there, hang on in there!!!!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 26, 2016, 09:32:48 AM
Quote from: Gryzor on September 26, 2016, 06:01:35 AM
I'd like to install this mod, however up to now I've been working with ILA - InLine Attachments (the old one). I was just wondering, what would happen with my old attachments in the posts?
The Post and PM Inline Attachments mod was designed to be compatible with that other mod.  That being said, there may be incompatibilities that I don't know about.  Please let me know of any problems that you encounter during your use!

Quote from: Gryzor on September 26, 2016, 06:01:35 AM
@dougiefresh: hope you're feeling better by now mate... we've all been there, hang on in there!!!!
Thanks!  Things are working themselves out.... Slowly, but surely.  2016 is the year of change for me!
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on September 26, 2016, 09:35:16 AM
Thanks for getting back to me! I actually wrote your previous post as I was writing mine, so I appreciate that you take the time to offer support...

I'll try installing it tomorrow and see what happens! Reason I want to get rid of ILA is that it throws thousands of errors in the logs, plus this mod replaces two others (for inline attachments AND PM attachments!)

Glad to hear it's going better, really am :)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 26, 2016, 09:49:37 AM
Quote from: Gryzor on September 26, 2016, 09:35:16 AM
I'll try installing it tomorrow and see what happens! Reason I want to get rid of ILA is that it throws thousands of errors in the logs, plus this mod replaces two others (for inline attachments AND PM attachments!)
It doesn't replace the PM attachments mod, rather it supplements the PM attachment mod to allow the PM system to show inline attachments....  I'm not duplicating the excellent PM attachments mod without the author's consent.  I'm also not going to try to write my own PM attachments system, as I don't think I could do any better than the PM attachment mod without duplicating (or risk being accused of duplicating) code from that mod....
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on September 27, 2016, 07:06:04 AM
Ah, thanks for the clarification :)

Ok, today I uninstalled ILA and installed your mod. Fixed permissions, but:

when posting the attachments system appears I can attach files, but the "insert attachment" link does nothing! As a result, they end up as just attachments, not inline... any ideas?

Worth mentioning that the mod installed without problems.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 27, 2016, 09:52:18 PM
Quote from: Gryzor on September 27, 2016, 07:06:04 AM
when posting the attachments system appears I can attach files, but the "insert attachment" link does nothing! As a result, they end up as just attachments, not inline... any ideas?
I'm looking into this bug report....
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on September 28, 2016, 03:20:38 AM
Thanks man. If you need any help from me, do let me know, I'd be more than happy to!
Title: Re: Post and PM Inline Attachments
Post by: JerzyLS on October 14, 2016, 12:39:11 PM
Hey Dougie,

I just installed PM Attachments (first) and Post and PM Inline Attachments on clean version of SMF.

It's not working for me.

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 16, 2016, 07:27:09 AM
Quote from: JerzyLS on October 14, 2016, 12:39:11 PM
I just installed PM Attachments (first) and Post and PM Inline Attachments on clean version of SMF.
Contents of the post might be helpful....
Title: Re: Post and PM Inline Attachments
Post by: JerzyLS on October 16, 2016, 11:57:10 AM
Content? I see [attachment] in every time, when I want to send somebody an attachment through PM system.

In the messege is only:

[attachment id=1 msg=new]


Title: Re: Post and PM Inline Attachments
Post by: Adrek on October 16, 2016, 12:43:58 PM
msg value should be number instead of text
Title: Re: Post and PM Inline Attachments
Post by: JerzyLS on October 16, 2016, 12:48:07 PM
Quote from: phantomm on October 16, 2016, 12:43:58 PM
msg value should be number instead of text

Yeah, in posts it's working fine.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 16, 2016, 01:39:01 PM
Quote from: JerzyLS on October 16, 2016, 11:57:10 AM
Content? I see [attachment] in every time, when I want to send somebody an attachment through PM system.

In the messege is only:

[attachment id=1 msg=new]
AH!!  So, it's in the PM section that you're having trouble!  I'll look into it!

Quote from: svendsen on June 25, 2016, 10:30:04 AM
There is also a size issue. I had to mod the code, so that no pic would be shown bigger then 800x600. This would have been nice if I could controll trough the controll center. I do not like going in and changing others work. I have made enough code, that I try my best to respect others work.
I've added a size control to the ILA admin settings area for the next version.  Hopefully, that will work for you....

Quote from: Gryzor on September 27, 2016, 07:06:04 AM
when posting the attachments system appears I can attach files, but the "insert attachment" link does nothing! As a result, they end up as just attachments, not inline... any ideas?
I've changed the "guts" of the mod for the next version so that references to href="javascript:void(0)" are completely removed from my additions.  My research indicates that it was necessary for "older" browsers (no idea how old), but is unnecessary for "modern" browsers....  We will see....

Quote from: timidapsin on July 14, 2016, 09:25:44 AM
Hello anyone here, please i need help..
When a user clicks insert attachment 1, it insert's [attachment id=1 msg=new] into  the post box, is it possible to make it insert something like
[attachment=1] or instead.
please i need a reply from anyone  :-[ , thank you
I've removed the msg=new portion from the code.  I'm working on new code to select which form to insert the attachment tag into....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 16, 2016, 04:15:27 PM
UPDATE: I've fixed up the "insert attachment" function so that it inserts one of 3 different formats:
o [attachment=0]
o [attachment id=0]
o [attachment id=0 msg=new]
It will be included for the next version.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 17, 2016, 08:11:58 AM
Uploaded v4.16 - October 16th, 2016
o Added maximum display width and height fields to ILA settings page.
o Added ILA insert format selector to ILA settings page.
o Modified code so that insert ILA code inserts requested format ILA tag into post.
o Modified code so that ILA maximum display values are used instead of attachment settings values.
o Modified code so that ILA maximum display values take priority over user-specified values.
o Modified admin code that didn't correctly cache update mod query response to website.
o Removed all href="javascript:void(0)" references from all XML files.
o Merge language XML files with language PHP files.
o Fixed changelog so that versions before 3.1 are accounted for.




@JerzyLS:  Your situation hasn't been addressed yet.  My apologizes for this....
Title: Re: Post and PM Inline Attachments
Post by: LG965 on October 22, 2016, 05:45:20 AM
Hello Dougie, I'm using your mod a few days, I noticed that when there are "quote" or "code" in the post, some images are not shown.
In the code below, it does not appear the last picture. Can you try my post somewhere? (I put * in te tag so here does not interpret)




[attachment id=1 width=400 float=right margin-left=20 border-style=dotted border-width=10 border-color=#888 msg=50451]Dopo anni di attesa, di schicchere e scintille dalla scheda madre (con qualche conseguenza) e di prestazioni sempre più anacronistiche, anche io (...rullo di tamburi...) ho finalmente cambiato pc, complice un casuale periodo di congiunture economiche migliori del solito!
Il mio ex pc era ormai arrivato da un pezzo al punto in cui, se ci dovevo fare qualcosa, prima lo andavo ad accendere, poi andavo in giro per casa a fare altro. Ultimamente poi stava cedendo senza più vergogna, impallamenti inspiegabili, lentezza...

[attachment id=1 width=400 float=right margin-left=20 border-style=dotted border-width=10 border-color=#888 msg=50451]

Da troppo tempo pensavo di cambiarlo, e (problemi di sicurezza e performance preistoriche a parte) il cessato supporto di Dropbox a XP è stata la goccia che mancava al traboccamento.
Cercando informazioni hardware su Tuttovola, anche per ricostruire un po' la storia dei miei acquisti, sono usciti fuori diversi vecchi thread in cui dichiaravo solennemente che "stavo per cambiare" pc..
Dopo anni di attesa, di schicchere e scintille dalla scheda madre (con qualche conseguenza) e di prestazioni sempre più anacronistiche, anche io (...rullo di tamburi...) ho finalmente cambiato pc, complice un casuale periodo di congiunture economiche migliori del solito!
Il mio ex pc era ormai arrivato da un pezzo al punto in cui, se ci dovevo fare qualcosa, prima lo andavo ad accendere, poi andavo in giro per casa a fare altro. Ultimamente poi stava cedendo senza più vergogna, impallamenti inspiegabili, lentezza...
[url=http://nonciclopedia.wikia.com/wiki/Live_for_Speed]http://nonciclopedia.wikia.com/wiki/Live_for_Speed[/url]
[*quote]LFS è un progetto in continua crescita. Mancano ancora per esempio l'evoluzione dinamica del meteo e delle relative condizioni della pista, gare in notturna, transizione giorno/notte, aerodinamica modificata da eventuali deformazioni subìte dalla carrozzeria, animazioni ai box...tutte cose previste per il futuro.[*/quote]

Da troppo tempo pensavo di cambiarlo, e (problemi di sicurezza e performance preistoriche a parte) il cessato supporto di Dropbox a XP è stata la goccia che mancava al traboccamento.
Cercando informazioni hardware su Tuttovola, anche per ricostruire un po' la storia dei miei acquisti, sono usciti fuori diversi vecchi thread in cui dichiaravo solennemente che "stavo per cambiare" pc..

[attachment id=2 width=190 float=right margin-left=20 msg=50451]
Dopo anni di attesa, di schicchere e scintille dalla scheda madre (con qualche conseguenza) e di prestazioni sempre più anacronistiche, anche io (...rullo di tamburi...) ho finalmente cambiato pc, complice un casuale periodo di congiunture economiche migliori del solito!
Il mio ex pc era ormai arrivato da un pezzo al punto in cui, se ci dovevo fare qualcosa, prima lo andavo ad accendere, poi andavo in giro per casa a fare altro. Ultimamente poi stava cedendo senza più vergogna, impallamenti inspiegabili, lentezza...

[*code]L'astuto Team di sviluppo: pilota Scawen Roberts, programmazione - passeggero Eric Bailey, grafica e suoni - sedile posteriore Victor Von Vlaardingen, webmaster
[*/code]


Da troppo tempo pensavo di cambiarlo, e (problemi di sicurezza e performance preistoriche a parte) il cessato supporto di Dropbox a XP è stata la goccia che mancava al traboccamento.[attachment id=3 width=190 float=left margin-right=20 msg=50451]
Cercando informazioni hardware su Tuttovola, anche per ricostruire un po' la storia dei miei acquisti, sono usciti fuori diversi vecchi thread in cui dichiaravo solennemente che "stavo per cambiare" pc..
Dopo anni di attesa, di schicchere e scintille dalla scheda madre (con qualche conseguenza) e di prestazioni sempre più anacronistiche, anche io (...rullo di tamburi...) ho finalmente cambiato pc, complice un casuale periodo di congiunture economiche migliori del solito!
Il mio ex pc era ormai arrivato da un pezzo al punto in cui, se ci dovevo fare qualcosa, prima lo andavo ad accendere, poi andavo in giro per casa a fare altro. Ultimamente poi stava cedendo senza più vergogna, impallamenti inspiegabili, lentezza...
[*code]- molti miglioramenti per chi usa il VR: nuova tastiera virtuale a schermo (tasto Backspace) per abilitare il sistema "guarda e clicca" ed eliminare la necessità del mouse. Avere disponibile una tastiera virtuale significa non dover usare quella reale, che è sempre stato un bel problema quando si indossa un casco/visore VR. Si può cliccare con un pulsante o con la barra spaziatrice
- aggiornato il supporto ad OpenVR
- migliorìe per il multiplayer: un nuovo filtro sui server DEMO permette di trovare subito il server che si desidera
- migliorato il sistema di sterzo
- resi più fluidi i replay
- migliorìe anche sul versante audio: creato un sistema per abilitare una suono di sirena sulle auto (solo se dotate di clackson). Il comando per attivare la sirena sulla macchina selezionata è /siren=off/fast/slow. La sirena è permessa solo se l'utente è stato abilitato al suo uso dal server host. Il comando per permettere al guest multiplayer l'uso della sirena è: /cansiren username 1
- effetto Doppler abilitato su tutti i suoni
- molti altri miglioramenti riguardanti: layout editor, editor di lezioni di allenamento, vari bugfix
- Aggiornato il circuito di Rockingham
- Modalità di finestre senza bordi (borderless), per un migliore supporto a sistemi multi-monitor; ciò permette di passare ad altri programmi con ALT+TAB senza minimizzare LFS
- Molte migliorie interne, dedicate agli sviluppatori di add-on
- IA migliorata
- Layout Editor migliorato
- Finalmente pubblicato il circuito di Rockingham (S3), che include 11 diverse configurazioni
- Migliorie grafiche, riflessi dinamici parametrizzabili
- IA migliorata, non tampona più come una volta
- Aumentati gli slot disponibili in single- e multiplayer
- Supportati fino a 10 controller
- Nuovo editor delle lezioni di guida
- Supporto periferiche 3D per Oculus Rift e HTC Vive
- Riorganizzazione dei buffer dei vertici statici per ridurre le istruzioni DirectX
- Bufferizzazione dei frame (default 1) per permettere l'inizio della renderizzazione del frame seguente
- Un più efficiente sistema di ordinamento della distanza delle macchine per suono e grafica
- I buffer dei vertici dinamici ora usano l'elaborazione hardware dei vertici
- Frame rate più alti in punti dove sono visibili molti oggetti
- Texture del cielo visualizzate negli specchietti retrovisori
- I pulsanti per la selezione degli oggetti nel layout editor sono ordinati per distanza
- L'impostazione di profondità dello Z-buffer può essere cambiato senza dover rilanciare LFS
- Gli specchietti usano ora una profondità dello Z-buffer di 24 bit se questo è impostato a più di 16
- Nuova schermata di informazioni per "sleep" / "aggiornamenti fisici" / "attesa gpu";
- Prevenzione di lag migliorata tramite l'uso di "event query" al posto di "lock";
- Impostazione minima di sleep modificata in "Sleep every frame" (yes / no);
- Circuito di Westhill totalmente ridisegnato (passato da 1 a 5 configurazioni). Pieno supporto alle configurazioni aperte che includono tutte le strade di accesso e secondarie;
- Layout Editor potenziato con l'aggiunta di nuovi oggetti ed una moltitudine di migliorie;
- Rendering Oculus Rift migliorato;
- Massimo numero di vetture in gara aumentato da 32 a 40;
- Circuito di Blackwood Rallycross: massimo numero di vetture in gara aumentato da 24 a 30;
- Supporto a Oculus Rift DK2 (Development Kit 2), occhiali 3D, proiettori, e molti altri tipi di TV e monitor 3D
- La grafica di tutti gli oggetti che presentano una trasparenza (alberi, tralicci, ecc.) è stata migliorata moltissimo, adottando un diverso modello di rendering
- 2 nuovi formati 3D in modalità TV / monitor /proiettore: stereogramma classico e ad "occhi incrociati" senza occhialini
- L'utilizzo di nuovi shaders per le macchine permettono di ottenere un maggiore frame rate con molte macchine a video. Le situazioni in cui c'è una griglia di partenza affollata sono ora molto fluide in termini di [i]fps[/i]
- Il filtro anisotropico è ora impostato a 4x di default, ed il valore degli slider del mip bias sono salvati in modo diverso nel file cfg.txt. Per questo si devono reimpostare i nostri valori preferiti di mip bias e di AF
- Aumentata la distanza massima di disegno oggetti in multiplayer
- Se necessario le texture sono automaticamente convertite e salvate nel formato corretto per avere minori tempi di caricamento
- Le textures a bassa risoluzione ora vengono caricate altrettanto velocemente di quelle ad alta risoluzione
- Molti altri bug risolti e molte correzioni alle traduzioni
- Aggiornamento del motore grafico alle DirectX 9 (le versioni precedenti supportavano le DirectX 8.1)
- L'accelerometro laterale e longitudinale ora funziona realisticamente
- Meteo casuale preimpostato di default quando si seleziona un circuito
- Possibilità di attivare l'antialiasing sugli specchietti (Opzioni - Grafica)
- Gli screenshot possono essere salvati (CTRL+S) in formato bmp/jpg/png (Opzioni - Misc)
- Il messaggio "Circuito caricato" ora visualizza il nome del circuito
- Strani problemi nel movimento verticale di alcuni slider
- Il casco non cambiava dopo aver cambiato pilota nei replay multigiocatore
- Alcune periferiche causavano la non disponibilità degli assi del mouse
- LFS andava in crash se si connettevano più di 8 periferiche di gioco
- Transizioni più pulite tra le schermate di interfaccia
- Il setup si poteva a volte corrompere nel momento dell'ingresso in gioco, o quando si restava a guardare la gara senza correre ("spectated")
- sistema mutiplayer completamente riscritto ed ottimizzato
- nuovo sistema "istantaneo" di [i]join[/i] (il momento dell'ingresso in un server) per una connessione più veloce ed affidabile
- giocatori con una connessione lenta non causano più ritardi e [i]lag[/i] ad altri giocatori
- nuovo sistema di memorizzazione e buffering dei pacchetti per ridurre il carico del server
- nuovo sistema di protezione e rilevamento [i]hacking[/i] e [i]cheating[/i]
- ottimizzazioni grafiche = frame rate incrementato
- sistema di collisione migliorato
- corretti diversi bug su vari circuiti
- gestione temperatura pneumatici nel box per modalità [i]hot lapping[/i]
- limite di oggetti posizionabili nel [i]layout editor[/i] elevato a 800
- nuovi oggetti disponibili per tutti i circuiti
- nuova gestione del punto di vista nel [i]layout editor[/i] (Shift+U - free view)
- configurazioni di layout a "circuito aperto" ([i]open track configurations[/i]) che permettono di correre su un circuito sfruttando tutte le sue configurazioni (o solo alcune) [b]contemporaneamente[/b]
- integrato il supporto al nuovo protocollo [b]lfs://[/b], per entrare su server specifici inserendo direttamente l'indirizzo nel browser (Vedi più avanti il paragrafo dedicato a [b]LFS World[/b])
- ABS sull'impianto frenante di alcune vetture stradali (XRG / RB4 / FXO / XRT / FZ5). L'entrata in funzione dell'ABS è evidenziata dal colore arancione nella schermata della temperatura gomme - tasto F9
- perfezionata la grafica dei cruscotti delle auto "stradali"
- un nuovo sistema di animazione delle ruote e rotazione dei dischi dei freni (FBM / XRG / XRT / XRR)
- rendering delle ombre migliorato
- illuminazione ambientale migliorata
- lista dei server [i]drasticamente[/i] velocizzata e riorganizzata con molti più filtri, ora può direttamente visualizzare i piloti presenti su ciascun server
- potente e flessibile supporto ai sistemi multischermo (fino a 11), per una visione a 360°!
- la mia traduzione  in italiano ;) del training e di tutta la documentazione (in collaborazione con Garam, il traduttore italiano ufficiale di LFS) WOW!! E sono pure citato nei titoli di coda!![*/code]
Da troppo tempo pensavo di cambiarlo, e (problemi di sicurezza e performance preistoriche a parte) il cessato supporto di Dropbox a XP è stata la goccia che mancava al traboccamento.
Cercando informazioni hardware su Tuttovola, anche per ricostruire un po' la storia dei miei acquisti, sono usciti fuori diversi vecchi thread in cui dichiaravo solennemente che "stavo per cambiare" pc..



One more thing, how come they do not show the images if the post, using simpleportal mod, is classified as an article and posted on the home page?

Thanks for your time!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 22, 2016, 11:46:55 AM
Quote from: LG965 on October 22, 2016, 05:45:20 AM
Hello Dougie, I'm using your mod a few days, I noticed that when there are "quote" or "code" in the post, some images are not shown.
In the code below, it does not appear the last picture. Can you try my post somewhere? (I put * in te tag so here does not interpret)




[attachment id=1 width=400 float=right margin-left=20 border-style=dotted border-width=10 border-color=#888 msg=50451]Dopo anni di attesa, di schicchere e scintille dalla scheda madre (con qualche conseguenza) e di prestazioni sempre più anacronistiche, anche io (...rullo di tamburi...) ho finalmente cambiato pc, complice un casuale periodo di congiunture economiche migliori del solito!
Il mio ex pc era ormai arrivato da un pezzo al punto in cui, se ci dovevo fare qualcosa, prima lo andavo ad accendere, poi andavo in giro per casa a fare altro. Ultimamente poi stava cedendo senza più vergogna, impallamenti inspiegabili, lentezza...

[attachment id=1 width=400 float=right margin-left=20 border-style=dotted border-width=10 border-color=#888 msg=50451]

Da troppo tempo pensavo di cambiarlo, e (problemi di sicurezza e performance preistoriche a parte) il cessato supporto di Dropbox a XP è stata la goccia che mancava al traboccamento.
Cercando informazioni hardware su Tuttovola, anche per ricostruire un po' la storia dei miei acquisti, sono usciti fuori diversi vecchi thread in cui dichiaravo solennemente che "stavo per cambiare" pc..
Dopo anni di attesa, di schicchere e scintille dalla scheda madre (con qualche conseguenza) e di prestazioni sempre più anacronistiche, anche io (...rullo di tamburi...) ho finalmente cambiato pc, complice un casuale periodo di congiunture economiche migliori del solito!
Il mio ex pc era ormai arrivato da un pezzo al punto in cui, se ci dovevo fare qualcosa, prima lo andavo ad accendere, poi andavo in giro per casa a fare altro. Ultimamente poi stava cedendo senza più vergogna, impallamenti inspiegabili, lentezza...
[url=http://nonciclopedia.wikia.com/wiki/Live_for_Speed]http://nonciclopedia.wikia.com/wiki/Live_for_Speed[/url]
[*quote]LFS è un progetto in continua crescita. Mancano ancora per esempio l'evoluzione dinamica del meteo e delle relative condizioni della pista, gare in notturna, transizione giorno/notte, aerodinamica modificata da eventuali deformazioni subìte dalla carrozzeria, animazioni ai box...tutte cose previste per il futuro.[*/quote]

Da troppo tempo pensavo di cambiarlo, e (problemi di sicurezza e performance preistoriche a parte) il cessato supporto di Dropbox a XP è stata la goccia che mancava al traboccamento.
Cercando informazioni hardware su Tuttovola, anche per ricostruire un po' la storia dei miei acquisti, sono usciti fuori diversi vecchi thread in cui dichiaravo solennemente che "stavo per cambiare" pc..

[attachment id=2 width=190 float=right margin-left=20 msg=50451]
Dopo anni di attesa, di schicchere e scintille dalla scheda madre (con qualche conseguenza) e di prestazioni sempre più anacronistiche, anche io (...rullo di tamburi...) ho finalmente cambiato pc, complice un casuale periodo di congiunture economiche migliori del solito!
Il mio ex pc era ormai arrivato da un pezzo al punto in cui, se ci dovevo fare qualcosa, prima lo andavo ad accendere, poi andavo in giro per casa a fare altro. Ultimamente poi stava cedendo senza più vergogna, impallamenti inspiegabili, lentezza...

[*code]L'astuto Team di sviluppo: pilota Scawen Roberts, programmazione - passeggero Eric Bailey, grafica e suoni - sedile posteriore Victor Von Vlaardingen, webmaster
[*/code]


Da troppo tempo pensavo di cambiarlo, e (problemi di sicurezza e performance preistoriche a parte) il cessato supporto di Dropbox a XP è stata la goccia che mancava al traboccamento.[attachment id=3 width=190 float=left margin-right=20 msg=50451]
Cercando informazioni hardware su Tuttovola, anche per ricostruire un po' la storia dei miei acquisti, sono usciti fuori diversi vecchi thread in cui dichiaravo solennemente che "stavo per cambiare" pc..
Dopo anni di attesa, di schicchere e scintille dalla scheda madre (con qualche conseguenza) e di prestazioni sempre più anacronistiche, anche io (...rullo di tamburi...) ho finalmente cambiato pc, complice un casuale periodo di congiunture economiche migliori del solito!
Il mio ex pc era ormai arrivato da un pezzo al punto in cui, se ci dovevo fare qualcosa, prima lo andavo ad accendere, poi andavo in giro per casa a fare altro. Ultimamente poi stava cedendo senza più vergogna, impallamenti inspiegabili, lentezza...
[*code]- molti miglioramenti per chi usa il VR: nuova tastiera virtuale a schermo (tasto Backspace) per abilitare il sistema "guarda e clicca" ed eliminare la necessità del mouse. Avere disponibile una tastiera virtuale significa non dover usare quella reale, che è sempre stato un bel problema quando si indossa un casco/visore VR. Si può cliccare con un pulsante o con la barra spaziatrice
- aggiornato il supporto ad OpenVR
- migliorìe per il multiplayer: un nuovo filtro sui server DEMO permette di trovare subito il server che si desidera
- migliorato il sistema di sterzo
- resi più fluidi i replay
- migliorìe anche sul versante audio: creato un sistema per abilitare una suono di sirena sulle auto (solo se dotate di clackson). Il comando per attivare la sirena sulla macchina selezionata è /siren=off/fast/slow. La sirena è permessa solo se l'utente è stato abilitato al suo uso dal server host. Il comando per permettere al guest multiplayer l'uso della sirena è: /cansiren username 1
- effetto Doppler abilitato su tutti i suoni
- molti altri miglioramenti riguardanti: layout editor, editor di lezioni di allenamento, vari bugfix
- Aggiornato il circuito di Rockingham
- Modalità di finestre senza bordi (borderless), per un migliore supporto a sistemi multi-monitor; ciò permette di passare ad altri programmi con ALT+TAB senza minimizzare LFS
- Molte migliorie interne, dedicate agli sviluppatori di add-on
- IA migliorata
- Layout Editor migliorato
- Finalmente pubblicato il circuito di Rockingham (S3), che include 11 diverse configurazioni
- Migliorie grafiche, riflessi dinamici parametrizzabili
- IA migliorata, non tampona più come una volta
- Aumentati gli slot disponibili in single- e multiplayer
- Supportati fino a 10 controller
- Nuovo editor delle lezioni di guida
- Supporto periferiche 3D per Oculus Rift e HTC Vive
- Riorganizzazione dei buffer dei vertici statici per ridurre le istruzioni DirectX
- Bufferizzazione dei frame (default 1) per permettere l'inizio della renderizzazione del frame seguente
- Un più efficiente sistema di ordinamento della distanza delle macchine per suono e grafica
- I buffer dei vertici dinamici ora usano l'elaborazione hardware dei vertici
- Frame rate più alti in punti dove sono visibili molti oggetti
- Texture del cielo visualizzate negli specchietti retrovisori
- I pulsanti per la selezione degli oggetti nel layout editor sono ordinati per distanza
- L'impostazione di profondità dello Z-buffer può essere cambiato senza dover rilanciare LFS
- Gli specchietti usano ora una profondità dello Z-buffer di 24 bit se questo è impostato a più di 16
- Nuova schermata di informazioni per "sleep" / "aggiornamenti fisici" / "attesa gpu";
- Prevenzione di lag migliorata tramite l'uso di "event query" al posto di "lock";
- Impostazione minima di sleep modificata in "Sleep every frame" (yes / no);
- Circuito di Westhill totalmente ridisegnato (passato da 1 a 5 configurazioni). Pieno supporto alle configurazioni aperte che includono tutte le strade di accesso e secondarie;
- Layout Editor potenziato con l'aggiunta di nuovi oggetti ed una moltitudine di migliorie;
- Rendering Oculus Rift migliorato;
- Massimo numero di vetture in gara aumentato da 32 a 40;
- Circuito di Blackwood Rallycross: massimo numero di vetture in gara aumentato da 24 a 30;
- Supporto a Oculus Rift DK2 (Development Kit 2), occhiali 3D, proiettori, e molti altri tipi di TV e monitor 3D
- La grafica di tutti gli oggetti che presentano una trasparenza (alberi, tralicci, ecc.) è stata migliorata moltissimo, adottando un diverso modello di rendering
- 2 nuovi formati 3D in modalità TV / monitor /proiettore: stereogramma classico e ad "occhi incrociati" senza occhialini
- L'utilizzo di nuovi shaders per le macchine permettono di ottenere un maggiore frame rate con molte macchine a video. Le situazioni in cui c'è una griglia di partenza affollata sono ora molto fluide in termini di [i]fps[/i]
- Il filtro anisotropico è ora impostato a 4x di default, ed il valore degli slider del mip bias sono salvati in modo diverso nel file cfg.txt. Per questo si devono reimpostare i nostri valori preferiti di mip bias e di AF
- Aumentata la distanza massima di disegno oggetti in multiplayer
- Se necessario le texture sono automaticamente convertite e salvate nel formato corretto per avere minori tempi di caricamento
- Le textures a bassa risoluzione ora vengono caricate altrettanto velocemente di quelle ad alta risoluzione
- Molti altri bug risolti e molte correzioni alle traduzioni
- Aggiornamento del motore grafico alle DirectX 9 (le versioni precedenti supportavano le DirectX 8.1)
- L'accelerometro laterale e longitudinale ora funziona realisticamente
- Meteo casuale preimpostato di default quando si seleziona un circuito
- Possibilità di attivare l'antialiasing sugli specchietti (Opzioni - Grafica)
- Gli screenshot possono essere salvati (CTRL+S) in formato bmp/jpg/png (Opzioni - Misc)
- Il messaggio "Circuito caricato" ora visualizza il nome del circuito
- Strani problemi nel movimento verticale di alcuni slider
- Il casco non cambiava dopo aver cambiato pilota nei replay multigiocatore
- Alcune periferiche causavano la non disponibilità degli assi del mouse
- LFS andava in crash se si connettevano più di 8 periferiche di gioco
- Transizioni più pulite tra le schermate di interfaccia
- Il setup si poteva a volte corrompere nel momento dell'ingresso in gioco, o quando si restava a guardare la gara senza correre ("spectated")
- sistema mutiplayer completamente riscritto ed ottimizzato
- nuovo sistema "istantaneo" di [i]join[/i] (il momento dell'ingresso in un server) per una connessione più veloce ed affidabile
- giocatori con una connessione lenta non causano più ritardi e [i]lag[/i] ad altri giocatori
- nuovo sistema di memorizzazione e buffering dei pacchetti per ridurre il carico del server
- nuovo sistema di protezione e rilevamento [i]hacking[/i] e [i]cheating[/i]
- ottimizzazioni grafiche = frame rate incrementato
- sistema di collisione migliorato
- corretti diversi bug su vari circuiti
- gestione temperatura pneumatici nel box per modalità [i]hot lapping[/i]
- limite di oggetti posizionabili nel [i]layout editor[/i] elevato a 800
- nuovi oggetti disponibili per tutti i circuiti
- nuova gestione del punto di vista nel [i]layout editor[/i] (Shift+U - free view)
- configurazioni di layout a "circuito aperto" ([i]open track configurations[/i]) che permettono di correre su un circuito sfruttando tutte le sue configurazioni (o solo alcune) [b]contemporaneamente[/b]
- integrato il supporto al nuovo protocollo [b]lfs://[/b], per entrare su server specifici inserendo direttamente l'indirizzo nel browser (Vedi più avanti il paragrafo dedicato a [b]LFS World[/b])
- ABS sull'impianto frenante di alcune vetture stradali (XRG / RB4 / FXO / XRT / FZ5). L'entrata in funzione dell'ABS è evidenziata dal colore arancione nella schermata della temperatura gomme - tasto F9
- perfezionata la grafica dei cruscotti delle auto "stradali"
- un nuovo sistema di animazione delle ruote e rotazione dei dischi dei freni (FBM / XRG / XRT / XRR)
- rendering delle ombre migliorato
- illuminazione ambientale migliorata
- lista dei server [i]drasticamente[/i] velocizzata e riorganizzata con molti più filtri, ora può direttamente visualizzare i piloti presenti su ciascun server
- potente e flessibile supporto ai sistemi multischermo (fino a 11), per una visione a 360°!
- la mia traduzione  in italiano ;) del training e di tutta la documentazione (in collaborazione con Garam, il traduttore italiano ufficiale di LFS) WOW!! E sono pure citato nei titoli di coda!![*/code]
Da troppo tempo pensavo di cambiarlo, e (problemi di sicurezza e performance preistoriche a parte) il cessato supporto di Dropbox a XP è stata la goccia che mancava al traboccamento.
Cercando informazioni hardware su Tuttovola, anche per ricostruire un po' la storia dei miei acquisti, sono usciti fuori diversi vecchi thread in cui dichiaravo solennemente che "stavo per cambiare" pc..


I tried it on a clean localhost SMF 2.0.12 forum and it works for me. 

FIRST: If the option Allow quoted attachment images from another post? is unchecked, you will ALWAYS get the [ Invalid Attachment ] message at display time for your post.

SECOND:  If the option Should first attachment should be numbered "1"? is checked, make sure that the id parameter starts with 1, not 0.  (ie: 1, 2, 3, 4.... instead of 0, 1, 2, 3....)

Quote from: LG965 on October 22, 2016, 05:45:20 AM
One more thing, how come they do not show the images if the post, using simpleportal mod, is classified as an article and posted on the home page?
I'll look into it.
Title: Re: Post and PM Inline Attachments
Post by: LG965 on October 22, 2016, 07:28:48 PM
Ops... sorry guy, you have right I have to be more careful!

Quote from: dougiefresh on October 22, 2016, 11:46:55 AM
Quote from: LG965 on October 22, 2016, 05:45:20 AM
One more thing, how come they do not show the images if the post, using simpleportal mod, is classified as an article and posted on the home page?
I'll look into it.
thanks for it

One more thing, in the next release then add a link (look img attach) that opens a popup and show the code here below?
(I did it for me but it is a raw code from beginner!)

Cheers!

Quote
id={attachment id} => ID number of the attachment to show inline (NOT attachment number!)
width={width} => Desired width of image to show.  Valid: positive integers.
height={height} => Desired height of image to show.  Valid: positive integers.
float={float} => Floats image to relation to everything else.  Valid: left, right, center
margin={pixels} => Margin around inline attachment.  Valid: positive integers
margin-left={pixels} => Left margin around inline attachment.  Valid: positive integers
margin-right={pixels} => Right margin around inline attachment.  Valid: positive integers
margin-top={pixels} => Top margin around inline attachment.  Valid: positive integers
margin-bottom={pixels} => Bottom margin around inline attachment.  Valid: positive integers
border-style={style} => Border style.  Valid: none, dotted, dashed, solid, double, groove, ridge, inset, outset
border-width={pixels} => Border width around inline attachment.  Valid: positive integers
border-color={color} => Border color.  Valid formats: plain text, #xxx, #xxxxxx, rbg(d,d,d)
scale={answer} => Override scaling of image.  Valid: true, false, yes, no
msg={msg ID} => Message ID number.  Valid: positive integers.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 22, 2016, 08:00:57 PM
Quote from: LG965 on October 22, 2016, 07:28:48 PM
One more thing, in the next release then add a link (look img attach) that opens a popup and show the code here below?
(I did it for me but it is a raw code from beginner!)

Cheers!

Quote
id={attachment id} => ID number of the attachment to show inline (NOT attachment number!)
width={width} => Desired width of image to show.  Valid: positive integers.
height={height} => Desired height of image to show.  Valid: positive integers.
float={float} => Floats image to relation to everything else.  Valid: left, right, center
margin={pixels} => Margin around inline attachment.  Valid: positive integers
margin-left={pixels} => Left margin around inline attachment.  Valid: positive integers
margin-right={pixels} => Right margin around inline attachment.  Valid: positive integers
margin-top={pixels} => Top margin around inline attachment.  Valid: positive integers
margin-bottom={pixels} => Bottom margin around inline attachment.  Valid: positive integers
border-style={style} => Border style.  Valid: none, dotted, dashed, solid, double, groove, ridge, inset, outset
border-width={pixels} => Border width around inline attachment.  Valid: positive integers
border-color={color} => Border color.  Valid formats: plain text, #xxx, #xxxxxx, rbg(d,d,d)
scale={answer} => Override scaling of image.  Valid: true, false, yes, no
msg={msg ID} => Message ID number.  Valid: positive integers.
Hmmm....  Let me think about how to do this properly....
Title: Re: Post and PM Inline Attachments
Post by: LG965 on November 14, 2016, 01:18:20 PM
Hi Dougie,
any news for it?
Quote from: dougiefresh on October 22, 2016, 11:46:55 AM
Quote from: LG965 on October 22, 2016, 05:45:20 AM
One more thing, how come they do not show the images if the post, using simpleportal mod, is classified as an article and posted on the home page?
I'll look into it.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 14, 2016, 08:34:02 PM
Quote from: LG965 on November 14, 2016, 01:18:20 PM
Hi Dougie,
any news for it?
Quote from: dougiefresh on October 22, 2016, 11:46:55 AM
Quote from: LG965 on October 22, 2016, 05:45:20 AM
One more thing, how come they do not show the images if the post, using simpleportal mod, is classified as an article and posted on the home page?
I'll look into it.
Sorry, I haven't looked into the issue yet.
Title: Re: Post and PM Inline Attachments
Post by: Omebolle on December 25, 2016, 04:21:16 AM
Suddenly the mod isn't performing like it did. I upgraded the forum to SMF 2.0.12 lately. Before the attached pictures were auto thumb. Now they display full size?
my settings

Title: Re: Post and PM Inline Attachments
Post by: lf123123 on December 30, 2016, 04:41:06 AM
Since I upgraded from SMF 1.x to 2.0.12, I had to use a new modification to manage inline attachments and decided that I wanted to use this one. Now there is two problems:

Title: Re: Post and PM Inline Attachments
Post by: lf123123 on December 31, 2016, 06:56:09 AM
Additional information: I just tested and found out that everything I said is also true for the Core theme, so a different theme can be ruled out as a source of the problem.
Title: Re: Post and PM Inline Attachments
Post by: lf123123 on January 01, 2017, 10:55:03 AM
I tested it now: Both problems do only occur after installing the mod. Before installing and after uninstalling everything works fine.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 01, 2017, 11:13:11 AM
I'll look into your bug report....
Title: Re: Post and PM Inline Attachments
Post by: Omebolle on January 05, 2017, 09:29:10 AM
Bump..
Quote from: Omebolle on December 25, 2016, 04:21:16 AM
Suddenly the mod isn't performing like it did. I upgraded the forum to SMF 2.0.12 lately. Before the attached pictures were auto thumb. Now they display full size?
my settings
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 05, 2017, 09:59:43 AM
I will look into both bug reports.....
Title: Re: Post and PM Inline Attachments
Post by: kkog on February 09, 2017, 01:04:01 AM
I have installed the mod on SMF 2.0.13 and the options for attachmini and attach and attachthumb all display the image at full size.

On our system image attachments are automatically resized to a max of 800 pixels high or 800 pixels wide using the "Resize Attached Images" mod.

I see you are looking into a request from Omebolle,  my issue seems to be the same as theirs

Greg
KKOG Forum Admin

Title: Re: Post and PM Inline Attachments
Post by: LG965 on February 12, 2017, 08:37:45 AM
Bump

Quote from: LG965 on November 14, 2016, 01:18:20 PM
Hi Dougie,
any news for it?
Quote from: dougiefresh on October 22, 2016, 11:46:55 AM
Quote from: LG965 on October 22, 2016, 05:45:20 AM
One more thing, how come they do not show the images if the post, using simpleportal mod, is classified as an article and posted on the home page?
I'll look into it.

Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on February 13, 2017, 11:53:28 AM
I have error message when I try to install. :-(

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 13, 2017, 09:42:03 PM
Quote from: LG965 on November 14, 2016, 01:18:20 PM
Hi Dougie,
any news for it?
Quote from: dougiefresh on October 22, 2016, 11:46:55 AM
Quote from: LG965 on October 22, 2016, 05:45:20 AM
One more thing, how come they do not show the images if the post, using simpleportal mod, is classified as an article and posted on the home page?
I'll look into it.
Sorry about taking so long in order to find a solution to this issue.  I've got a fix in place for the next version.

Quote from: Denis Pageau on February 13, 2017, 11:53:28 AM
I have error message when I try to install. :-(
For the next version, I've changed the operation for Sources/Help.php to use a different line of text to search for.
Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on February 13, 2017, 09:46:31 PM
Quote from: dougiefresh on February 13, 2017, 09:42:03 PM
For the next version, I've changed the operation for Sources/Help.php to use a different line of text to search for.


Can I still install it?


Thanks for your answer Dougie.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 13, 2017, 09:48:16 PM
Quote from: Denis Pageau on February 13, 2017, 09:46:31 PM
Can I still install it?
Yes, you can.  However, keep in mind that the help options for the Admin settings won't be available to you.....
Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on February 13, 2017, 11:37:40 PM
Ok Thanks. I will test drive it to see how it handles. When do you think the next update will be available?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 14, 2017, 07:42:32 AM
Quote from: Denis Pageau on February 13, 2017, 11:37:40 PM
When do you think the next update will be available?
When it is ready.....  That's the best answer I can give at the moment.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 15, 2017, 02:58:44 PM
Quote from: dougiefresh on October 22, 2016, 08:00:57 PM
Quote from: LG965 on October 22, 2016, 07:28:48 PM
One more thing, in the next release then add a link (look img attach) that opens a popup and show the code here below?
(I did it for me but it is a raw code from beginner!)

Cheers!

Quote
id={attachment id} => ID number of the attachment to show inline (NOT attachment number!)
width={width} => Desired width of image to show.  Valid: positive integers.
height={height} => Desired height of image to show.  Valid: positive integers.
float={float} => Floats image to relation to everything else.  Valid: left, right, center
margin={pixels} => Margin around inline attachment.  Valid: positive integers
margin-left={pixels} => Left margin around inline attachment.  Valid: positive integers
margin-right={pixels} => Right margin around inline attachment.  Valid: positive integers
margin-top={pixels} => Top margin around inline attachment.  Valid: positive integers
margin-bottom={pixels} => Bottom margin around inline attachment.  Valid: positive integers
border-style={style} => Border style.  Valid: none, dotted, dashed, solid, double, groove, ridge, inset, outset
border-width={pixels} => Border width around inline attachment.  Valid: positive integers
border-color={color} => Border color.  Valid formats: plain text, #xxx, #xxxxxx, rbg(d,d,d)
scale={answer} => Override scaling of image.  Valid: true, false, yes, no
msg={msg ID} => Message ID number.  Valid: positive integers.
Hmmm....  Let me think about how to do this properly....
Feature added for next version.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 15, 2017, 09:36:22 PM
Now that I'm home, I can show y'all what I've devised for the next version.  Attached is the help screen popup....
Title: Re: Post and PM Inline Attachments
Post by: PBSCreative on February 16, 2017, 06:21:46 AM
I'm trying to figure out an issue with a forum which for some users is preventing them from uploading images and wondered if anyone else has seen similar with this extension.

Some users are posting and the images are not showing, instead they get  [ You are not allowed to view photos ] and moderators are asked to approve the image. If we try to approve then the message "You are not allowed to access this section"
In actual fact there's no image there to approve at all, it's like the image has failed to upload?

Also when Quoting a post with an image in we get [ Invalid Attachment ].
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 16, 2017, 09:01:34 AM
I haven't looked into that bug report yet.  I'm trying to get each of the bug reports fixed as they have been reported.  And boy, do I have a lot of bug reports to go through....  :-[
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 16, 2017, 10:37:28 AM
Quote from: dougiefresh on October 16, 2016, 01:39:01 PM
Quote from: JerzyLS on October 16, 2016, 11:57:10 AM
Content? I see [attachment] in every time, when I want to send somebody an attachment through PM system.

In the messege is only:

[attachment id=1 msg=new]
AH!!  So, it's in the PM section that you're having trouble!  I'll look into it!
I've fixed this issue within the PM system.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 16, 2017, 11:15:42 AM
Quote from: lf123123 on December 30, 2016, 04:41:06 AM
In the old version of our forum, inline attachments could be accessed with BBCodes like [attachment=1], [attachment=2], ...
Now, the correct syntax is [attachment=0], [attachment=1], ... the difference being an index shift. Therefore, all attachments are now shown in the wrong place.

I did notice the setting "Should first attachment should be numbered "1"?" but the problem is: If I change the setting from "begin with 0" to "begin with 1", all my messages are edited such that all indices are raised by 1, which I don't want in this case because then all attachments will still be shown in the wrong place just like before.

Is there any way to have all old attachments display correctly without having to manually go through all posts with inline attachments?
I've added a prompt to ask whether you want to renumber the attachments.  If you answer "Ok", then the attachments get renumbered.  Otherwise, they don't.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 16, 2017, 03:35:18 PM
Quote from: lf123123 on December 30, 2016, 04:41:06 AM
1) Old attachments now allegedly need to be approved by a moderator. When trying to approve them, I get an error that I don't have access to this area, although I'm logged in as an administrator. My board is configured such that new attachments do not need approval. In the database, all attachments are marked as approved.

The image which I attached to this post shows what the approval area looks like. Pleae notice that the corresponding post has two attachments. The "approval area" only shows one of them and doesn't display the filename. Something's definitely wrong here.

New attachments don't have this problem. No problems other than this one and the one mentioned as 2. have appeared after the update.

Can someone please tell me what I can do the get all attachments working again, ideally without having to manually touch each of them?
I've managed to reproduce something similar to this bug report.  It seems to happen when an attachment is referenced, but doesn't  exist.  For example, a post containing no attachments and also contains this line:
[attach=0]
brings up what you have described/pictured.  I'm looking into how to get rid of those issues....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 16, 2017, 06:11:35 PM
Quote from: dougiefresh on February 16, 2017, 03:35:18 PM
Quote from: lf123123 on December 30, 2016, 04:41:06 AM
1) Old attachments now allegedly need to be approved by a moderator. When trying to approve them, I get an error that I don't have access to this area, although I'm logged in as an administrator. My board is configured such that new attachments do not need approval. In the database, all attachments are marked as approved.

The image which I attached to this post shows what the approval area looks like. Pleae notice that the corresponding post has two attachments. The "approval area" only shows one of them and doesn't display the filename. Something's definitely wrong here.

New attachments don't have this problem. No problems other than this one and the one mentioned as 2. have appeared after the update.

Can someone please tell me what I can do the get all attachments working again, ideally without having to manually touch each of them?
I've managed to reproduce something similar to this bug report.  It seems to happen when an attachment is referenced, but doesn't  exist.  For example, a post containing no attachments and also contains this line:
[attach=0]
brings up what you have described/pictured.  I'm looking into how to get rid of those issues....
A simple check to see if the specified attachment ID actually exists solved the issue that I could see.  It will be included in the next version.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 16, 2017, 10:07:40 PM
Quote from: Omebolle on December 25, 2016, 04:21:16 AM
Suddenly the mod isn't performing like it did. I upgraded the forum to SMF 2.0.12 lately. Before the attached pictures were auto thumb. Now they display full size?
my settings
Quote from: kkog on February 09, 2017, 01:04:01 AM
I have installed the mod on SMF 2.0.13 and the options for attachmini and attach and attachthumb all display the image at full size.

On our system image attachments are automatically resized to a max of 800 pixels high or 800 pixels wide using the "Resize Attached Images" mod.

I see you are looking into a request from Omebolle,  my issue seems to be the same as theirs

Greg
KKOG Forum Admin
For the next version, I've rewritten a lot of the bbcode handling stuff within Subs-InlineAttachments.php, so hopefully this will take care of the issue(s) being seen.....  I've still got a ways to go yet, but it's getting there, slowly but surely.....



Quote from: PBSCreative on February 16, 2017, 06:21:46 AM
I'm trying to figure out an issue with a forum which for some users is preventing them from uploading images and wondered if anyone else has seen similar with this extension.

Some users are posting and the images are not showing, instead they get  [ You are not allowed to view photos ] and moderators are asked to approve the image. If we try to approve then the message "You are not allowed to access this section"
In actual fact there's no image there to approve at all, it's like the image has failed to upload?
This issue has been dealt with and the fix will be in the next version.

Quote from: PBSCreative on February 16, 2017, 06:21:46 AM
Also when Quoting a post with an image in we get [ Invalid Attachment ].
In the Inline Attachments settings page, there is an option called Allow quoted attachment images from another post?.  If that option is unchecked, then you will get that error message because the mod isn't allowed to pull attachment information from other quoted posts.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 17, 2017, 10:10:49 AM
Uploaded v5.0 - February 17th, 2016
o Added help link and popup window to the Post screen.
o Rewrote bbcode handling code to properly handle each bbcode.
o Modified Sources/Help.php operation to use different line to look for.
o Fixed issue where PMs with inline attachments only showed "[ Attachment ]"
o Fixed issue where SimplePortal didn't display embedded attachments.
o Fixed undefined index error in Subs-InlineAttachments.php when using HS4SMF mod.
o Fixed several undefined variable errors in Subs-InlineAttachments.php.
o Fixed incompatibility with PM Attachments version 2.0 Beta 1.
o Fixed PM issue where "[attachment id=0 msg=new]" returns "[ Attachment ]".
o Changed inline TXT files so that they are parsed (for security reasons!)




@Everybody:  Hopefully this updates solves the problems mentioned by everybody.  I'm sorry about the long wait for this update, but hopefully it has been worth the wait.....
Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on February 18, 2017, 09:06:16 AM
Thanks DougieFresh, I was able to install it but there were still a few error message. See attached images.
Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on February 18, 2017, 09:19:02 AM
Quote from: laetabi on March 13, 2016, 02:00:03 PM
Could I suggest an improvement for all the dumb users around?   I have many  :o

1) Change the SMF icon for 'Insert Image' so that it gives members two options:

    a) Enter Image Location... http:// (as now for selecting from an external hosting site or web page)
    b) Browse your computer... have the Browse button below this in the same window, just like it is for attachments

2) When using the Browse button and an image file is selected from their computer, use the Inline Attachments mod and the existing SMF code for uploading attachments to insert the BBC [ attachment = 1 ] etc, directly into the post where they have placed their cursor.



I second the motion. :-)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 18, 2017, 10:02:36 AM
Quote from: Denis Pageau on February 18, 2017, 09:06:16 AM
Thanks DougieFresh, I was able to install it but there were still a few error message. See attached images.
1st image: Attach your Sources/Help.php and Themes/Espagnol/PersonalMessage.template.php so that I can see what is going on.

2nd image: Whoops....  Forgot to put the ILA.css file where it needs to go....  Sorry about that....
Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on February 18, 2017, 10:13:43 AM
Here you go.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 23, 2017, 08:02:03 PM
Uploaded v5.1 - February 23rd, 2017
o Added an operation to copy ILA.css to proper folder.




@Denis Pageau:  I was able to get your PersonalMessage.template.php file to work correctly with the mod.  My instructions are going to assume you have a Windows machine available....

What I did was open a copy of Notepad2 (https://xhmikosr.github.io/notepad2-mod/), copy the replace box (Ctrl-E, then E), type in the following in the Search String field:
Code (Search for) Select
\r\n\r\n
and this in the Replace with field:
Code (Replace with) Select
\r\n
Check the Transform backslashes box, then click Replace All.  That fixed the file for me....  I've attached the fixed file for you....
Title: Re: Post and PM Inline Attachments
Post by: LG965 on February 24, 2017, 04:21:59 AM
Hello Doug,
I have two problem:
-Fixed issue where SimplePortal didn't display embedded attachments, don't work
-Automatically image resize, in image dispayed by ILA attach don't work (in 4.15 worked, resize image width=700px, but I do not know how)

Any ideas?


Title: Re: Post and PM Inline Attachments
Post by: lf123123 on February 24, 2017, 05:11:01 AM
Quote from: dougiefresh on February 16, 2017, 06:11:35 PM
Quote from: dougiefresh on February 16, 2017, 03:35:18 PM
Quote from: lf123123 on December 30, 2016, 04:41:06 AM
1) Old attachments now allegedly need to be approved by a moderator. When trying to approve them, I get an error that I don't have access to this area, although I'm logged in as an administrator. My board is configured such that new attachments do not need approval. In the database, all attachments are marked as approved.

The image which I attached to this post shows what the approval area looks like. Pleae notice that the corresponding post has two attachments. The "approval area" only shows one of them and doesn't display the filename. Something's definitely wrong here.

New attachments don't have this problem. No problems other than this one and the one mentioned as 2. have appeared after the update.

Can someone please tell me what I can do the get all attachments working again, ideally without having to manually touch each of them?
I've managed to reproduce something similar to this bug report.  It seems to happen when an attachment is referenced, but doesn't  exist.  For example, a post containing no attachments and also contains this line:
[attach=0]
brings up what you have described/pictured.  I'm looking into how to get rid of those issues....
A simple check to see if the specified attachment ID actually exists solved the issue that I could see.  It will be included in the next version.

Thank you for solving both problems I reported!




Edit: One more thing: Is is possible to hide the "inline attachment parameters" from the new post dialog altogether? With the Dilber MC theme we are using, this parameters list gets displayed like you can see in the attachment and I would rather not have it there at all. The option "Include link for ILA popup window parameters?" does not seem to have a visible effect.
Title: Re: Post and PM Inline Attachments
Post by: lf123123 on February 24, 2017, 05:45:08 AM
Quote from: LG965 on February 24, 2017, 04:21:59 AM
-Automatically image resize, in image dispayed by ILA attach don't work (in 4.15 worked, resize image width=700px, but I do not know how)

I can confirm that this also happens on my forum, but was unsure whether this mod is the source of the problem and therefore didn't report it yet. I noticed that for all affected images (for some it works, for some it doesn't), the size of the image is not displayed correctly. Example: While one of the images may be so large that it should be resized (e.g. 4000x3000 pixels), the size shown may just be 92x180 pixels.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 24, 2017, 04:45:53 PM
I'm sorry, the way you are reporting your problems is confusing.... 

Quote from: LG965 on February 24, 2017, 04:21:59 AM
-Fixed issue where SimplePortal didn't display embedded attachments, don't work
Are you reporting that SimplePortal still doesn't display the embedded attachments?  If so, I will need you to PM me some forum/website credentials to your forum, and a link of where to go so that I might be able to see the problem so that I can fix it....

Quote from: LG965 on February 24, 2017, 04:21:59 AM
-Automatically image resize, in image dispayed by ILA attach don't work (in 4.15 worked, resize image width=700px, but I do not know how)
Are you reporting that using the width=700px parameter doesn't work?  What version are you using?  I've tested the width parameter and it has worked for me....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 24, 2017, 08:46:40 PM
Uploaded v5.2 - February 24th, 2017
o Fixed issue where popup option wasn't linked to anything....
o Fixed responsive CSS image stuff that I added in version 5.0.
o Fixed scale parameter to disable/enable responsive stuff on request.
o Added admin option to enable responsive CSS image stuff.
o Added bbcode option to scale parameter to invert responsive settings.
Title: Re: Post and PM Inline Attachments
Post by: lf123123 on February 25, 2017, 06:53:34 AM
Quote from: dougiefresh on February 24, 2017, 08:46:40 PM
o Fixed issue where popup option wasn't linked to anything....

Thank you! I can confirm that the behaviour has changed when I updated to the latest version, but everything still looks like shown in the screenshot in this (http://www.simplemachines.org/community/index.php?topic=525705.msg3916019#msg3916019) post, with the exception noted below. Note that the inline attachment parameters are not shown in a popup window, but above the fields where you enter information about your new post.

What has changed is the following:
I'm still looking for a way (manual edit would be okay) to hide the inline attachment parameters from the "new reply" page. I tried to edit Themes/default/Post.template.php, but was only able to get rid of the ILA-related question mark, but that doesn't help.

Quote from: dougiefresh on February 24, 2017, 04:45:53 PM
Are you reporting that using the width=700px parameter doesn't work?  What version are you using?  I've tested the width parameter and it has worked for me....

When I said something about this issue in this (http://www.simplemachines.org/community/index.php?topic=525705.msg3916021#msg3916021) post, I did understand him differently. Anyway, here is the problem I'm experiencing, but again, I'm unsure if this mod is actually the source of the problem:

I set "Restrict images to maximum width of:" to "500", same for the height restriction. For some images, it works fine. For others, it doesn't. These images aren't resized although they are far wider than 500 pixels. That can lead to scrollbars appearing in posts. For all affected images, I noticed the following: When I set the inline attachments mod to display the size of the images in pixels, a wrong size is shown for all of these images. The width shown is less than the 500 pixels I set above*, while in reality the width might be 3000 pixels and the image is displayed with a width of 3000 pixels.

* That was at least until version 5.1. Since the update to 5.2, I'm not shown the size of images anymore, even though I set "Download link and counter setting:" to "Filename, Size, Dimensions and Count". In order to get it working again, I tried to set the option to a different value and then set it to "Filename, Size, Dimensions and Count" again, but that didn't help. I'm now shown a label of thefollowing form:  [filename] ([filesize] - [count]). I'm only mentioning this to give you the complete picture, this issue doesn't bother me at all.
Title: Re: Post and PM Inline Attachments
Post by: Kinsman on February 26, 2017, 01:33:40 AM
Is there a way to stop the bazillion examples always displaying above the posting box?
Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on February 26, 2017, 03:42:42 PM
Thank you DougieFresh it worked. 8)

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 26, 2017, 08:01:05 PM
@lf123123:  I'll look into it some more.....

Quote from: Kinsman on February 26, 2017, 01:33:40 AM
Is there a way to stop the bazillion examples always displaying above the posting box?
@Kinsman:  Have you upgraded to version 5.2 yet?

Quote from: Denis Pageau on February 26, 2017, 03:42:42 PM
Thank you DougieFresh it worked. 8)
@Denis Pageau:  You're welcome!
Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on February 27, 2017, 08:07:53 AM
Making the image insertion process more userfriendly.

here is an idea on how to make the process of integrating image in a post easier.

It is based on EZPortal's approach. (View attachment)





Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 27, 2017, 08:00:50 PM
@Denis Pageau:  Wow.....  That would be a hell of an improvement over the current method of inserting it....  A hell of a lot more complicated, too....  I would need time to implement this properly, and right now, I don't have time to implement something so drastic....  In a few days or next week, maybe....
Title: Re: Post and PM Inline Attachments
Post by: Kinsman on February 28, 2017, 04:10:41 AM

Quote from: Kinsman on February 26, 2017, 01:33:40 AM
Is there a way to stop the bazillion examples always displaying above the posting box?
@Kinsman:  Have you upgraded to version 5.2 yet?
[/quote]

Yep, still not seeing any way to remove them?
Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on February 28, 2017, 07:56:41 AM
Quote from: dougiefresh on February 27, 2017, 08:00:50 PM
@Denis Pageau:  Wow.....  That would be a hell of an improvement over the current method of inserting it....  A hell of a lot more complicated, too....  I would need time to implement this properly, and right now, I don't have time to implement something so drastic....  In a few days or next week, maybe....


Yes it would be a hell of an improvement. The present approach is OK forpeople who understand coding or want to learn, but for others, it is complicated.



Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 01, 2017, 08:35:16 PM
Quote from: Kinsman on February 26, 2017, 01:33:40 AM
Is there a way to stop the bazillion examples always displaying above the posting box?
Version 5.2 doesn't put the ILA.css file in the right place.  I'm trying to fix this issue, along with other issues that have been found....
Title: Re: Post and PM Inline Attachments
Post by: Omebolle on March 02, 2017, 03:14:24 AM
Just upgraded to 5.2, the attachments still don't resize/thumbnail? Are my settings off?
What inline attachment mod is used in this SMF forum? because here it works like I would like it to
Title: Re: Post and PM Inline Attachments
Post by: Arantor on March 02, 2017, 03:25:38 AM
This forum has no mods for attachments at all.
Title: Re: Post and PM Inline Attachments
Post by: Omebolle on March 02, 2017, 04:16:03 AM
I'm starting to understand. Thanks for the info

Saw in my previous post the attachment tag should be "attach" and the "attach" bbcode same as "attachment" should be un-checked.

Changed the settings and problem solved
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 04, 2017, 10:24:12 AM
Uploaded v5.3 - March 4th, 2017
o Fixed code that returns the image dimensions to the HTML building code.
o Removed ILA popup window with ILA parameters.  Will be replaced by new stuff....




@Kinsman: I've removed the code that shows the ILA parameters at the top of the page.  Sorry about that....

@Omebolle:  If you uncheck the Remove attachment image under post after in-post use? option in the Inline Attachments option page, you will see the attachment underneath the post, similar to what you would without the mod installed....

@Denis Pageau:  I'm still working on the replacement for ILA parameters window.....
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 04, 2017, 01:48:43 PM
Quote from: dougiefresh on February 24, 2017, 04:45:53 PM
I'm sorry, the way you are reporting your problems is confusing.... 

Quote from: LG965 on February 24, 2017, 04:21:59 AM
-Fixed issue where SimplePortal didn't display embedded attachments, don't work
Are you reporting that SimplePortal still doesn't display the embedded attachments?  If so, I will need you to PM me some forum/website credentials to your forum, and a link of where to go so that I might be able to see the problem so that I can fix it....

Quote from: LG965 on February 24, 2017, 04:21:59 AM
-Automatically image resize, in image dispayed by ILA attach don't work (in 4.15 worked, resize image width=700px, but I do not know how)
Are you reporting that using the width=700px parameter doesn't work?  What version are you using?  I've tested the width parameter and it has worked for me....

Hi,
I created a mirror site to test your mod, even the v5.3 does not work,
have a PM.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 05, 2017, 10:03:22 AM
Uploaded v5.3.1 - March 5th, 2017
o Removed debug statement accidentally left in the mod.




@LG965:  I accidentally left some debugging code in the mod.  I've removed it and uploaded the revised mod to your forum.  Inline attachments in SimplePortal articles isn't working at the moment, and I haven't been able to figure out why.....
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 05, 2017, 02:58:41 PM
Quote from: dougiefresh on March 05, 2017, 10:03:22 AM
@LG965: Inline attachments in SimplePortal articles isn't working at the moment, and I haven't been able to figure out why.....
OK I am sure you can understand  ;)



On my forum the old 4.15 resize image at 700px  :)  (if you want install it)

The new version 5 (all) don't resize!   link (http://www.test.tuttovola.org/index.php?topic=7720.0)

Probably some other mod creates the problem.

If you need everything to test your mod on my site ask me here or PM :)

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 06, 2017, 10:04:10 AM
@LG965: SimplePortal support is partially working at this point!  Yay!  I also fixed the issue with the Highslide support in the mod, so your images should be size-restricted again!  I had placed the image class in the "a href" html tag instead of the "img" tag....  DOH!!!
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 06, 2017, 12:50:23 PM
Quote from: dougiefresh on March 06, 2017, 10:04:10 AM
@LG965: I had placed the image class in the "a href" html tag instead of the "img" tag....  DOH!!!
Have you entered this fix in the mod v5.3.1 or have you manually changed some files?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 06, 2017, 04:33:27 PM
No, the highslide fix hasn't been released yet in the Customization Site....  I'm still looking at why the mod isn't working for some Simple portal articles....   However, you have the latest version on your site....
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 07, 2017, 05:38:04 AM
Sorry but I did not understand what you've done to fix in my mirror site...  :-[
Title: Re: Post and PM Inline Attachments
Post by: DenDen60 on March 07, 2017, 07:06:40 AM
Thanks for your efforts Dougiefresh.
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 07, 2017, 05:51:37 PM
Have other two trouble...  ???

http://www.test.tuttovola.org/index.php?board=65.0
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 07, 2017, 08:54:44 PM
Quote from: LG965 on March 07, 2017, 05:38:04 AM
Sorry but I did not understand what you've done to fix in my mirror site...  :-[
Regarding the Highslide support, I had introduced a new class for inline attachments, and had placed the class="ila_attach" in the link referrer instead of the image tag.  End result being an image that wasn't automatically resized properly.

Regarding SimplePortal support, hell if I know....  There is nothing in the mod that would directly affect the SimplePortal mod.  I'm thinking maybe uninstalling, then reinstalling it after SimplePortal made a difference.....

Quote from: LG965 on March 07, 2017, 05:51:37 PM
Have other two trouble...  ???

http://www.test.tuttovola.org/index.php?board=65.0
I've traced the first screenshot issue to an incompatibility with the URL Popup (http://custom.simplemachines.org/mods/index.php?mod=3832) mod, and have fixed this particular issue for version 5.4.

I'm still working on the second issue you found....
Title: Re: Post and PM Inline Attachments
Post by: Krel on March 08, 2017, 06:42:07 AM
Another one problem. 2.0.13.
When I click at "more attachements", new field with "choose file" button doesn't add. I can't add more than one attachement :(
When I delete mod all works well again.
sorry for my english.
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 08, 2017, 08:09:53 AM
Quote from: dougiefresh on March 07, 2017, 08:54:44 PM
Regarding the Highslide support, I had introduced a new class for inline attachments, and had placed the class="ila_attach" in the link referrer instead of the image tag.  End result being an image that wasn't automatically resized properly.
Great!

Quote from: dougiefresh on March 07, 2017, 08:54:44 PM
Regarding SimplePortal support, hell if I know....  There is nothing in the mod that would directly affect the SimplePortal mod.  I'm thinking maybe uninstalling, then reinstalling it after SimplePortal made a difference.....
Try it but nothing has changed


Quote from: dougiefresh on March 07, 2017, 08:54:44 PM
I've traced the first screenshot issue to an incompatibility with the URL Popup (http://custom.simplemachines.org/mods/index.php?mod=3832) mod, and have fixed this particular issue for version 5.4.

I'm still working on the second issue you found....
Good job!




Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 08, 2017, 09:18:32 AM
Quote from: Krel on March 08, 2017, 06:42:07 AM
Another one problem. 2.0.13.
When I click at "more attachements", new field with "choose file" button doesn't add. I can't add more than one attachement :(
When I delete mod all works well again.
sorry for my english.
I will look into this bug report....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 09, 2017, 04:51:45 PM
Quote from: LG965 on March 07, 2017, 05:51:37 PM
Have other two trouble...  ???

http://www.test.tuttovola.org/index.php?board=65.0
It's been fixed on your website, and has been incorporated into version 5.4.

Quote from: Krel on March 08, 2017, 06:42:07 AM
Another one problem. 2.0.13.
When I click at "more attachements", new field with "choose file" button doesn't add. I can't add more than one attachement :(
When I delete mod all works well again.
sorry for my english.
I've reproduced the bug report that you made.  I'm working on it....
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 09, 2017, 05:40:56 PM
Quote from: dougiefresh on March 09, 2017, 04:51:45 PM
Quote from: LG965 on March 07, 2017, 05:51:37 PM
Have other two trouble...  ???
http://www.test.tuttovola.org/index.php?board=65.0
It's been fixed on your website, and has been incorporated into version 5.4.

I believe there is still a bug in a BBC tag code  http://www.test.tuttovola.org/index.php?topic=7724.0
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 09, 2017, 08:08:51 PM
Quote from: LG965 on March 09, 2017, 05:40:56 PM
I believe there is still a bug in a BBC tag code  http://www.test.tuttovola.org/index.php?topic=7724.0
Wow, that's a weird one....  I verified that one on your server.  Let me see if I can verify the bug report on my localhost forum.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 09, 2017, 10:14:04 PM
@LG965: The bug you mentioned also seemed kinda random....  On second round of testing, the new topic was placed in a completely different topic, which suggested something irritating.  I looked at the other mods and couldn't find one that might make the required changes....  So I uninstalled the ILA mod from your server, and POOF, the bug disappeared!

So that completely narrowed it down to the mod itself....  Turns out the mod was inadvertently changing which topic to place the new post in!  So a bit of rewriting later, the mod allows the forum to correctly deposit the new topic/post where the user wants it to go, instead of.... well, where-ever!  :P

As a side note, this rewrite also seems to solve the rest of the SimplePortal article issue you reported, which was a surprise to me!  Also, your server has the latest mod version....

EDIT:  On a humorous note, I managed to stick an inline attachment as a piece of news in the admin panel (Admin => Main => News and Newsletters), suggesting (at least to me) that as long as the ILA tag has the message ID number, it SHOULDN'T matter if the message ID wasn't passed by the code to the parsing function.  I'd show the resulting picture of the news I "made", but I really don't want to offend anybody.....  (I think it's hilarious!)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 10, 2017, 10:29:19 AM
Uploaded v5.4 - March 10th, 2017
o Fixed readme compatibility note about HS4SMF mod being installed first.
o Fixed issue where topic ID was changed by code pulling attachments.
o Fixed issue where ILA tags within code tags were incorrectly translated.
o Fixed issue with Highslide mods and maximum width/height settings.
o Fixed incompatibility with URL Popup (http://custom.simplemachines.org/mods/index.php?mod=3832) mod.
o Fixed error where unable to load language file after uninstalling.




@Everybody:  I decided that the number of fixes, the last few of them being more critical, made getting this out as the finalized version 5.4 more important than continuing to fix the few minor bugs left.  I apologize if this upsets anybody....

@LG965: Btw, your test server already has this version on it....
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 10, 2017, 12:16:09 PM
Quote from: dougiefresh on March 09, 2017, 10:14:04 PM
@LG965: The bug you mentioned also seemed kinda random....  On second round of testing, the new topic was placed in a completely different topic, which suggested something irritating.  I looked at the other mods and couldn't find one that might make the required changes....  So I uninstalled the ILA mod from your server, and POOF, the bug disappeared!

So that completely narrowed it down to the mod itself....  Turns out the mod was inadvertently changing which topic to place the new post in!  So a bit of rewriting later, the mod allows the forum to correctly deposit the new topic/post where the user wants it to go, instead of.... well, where-ever!  :P

As a side note, this rewrite also seems to solve the rest of the SimplePortal article issue you reported, which was a surprise to me!  Also, your server has the latest mod version....

EDIT:  On a humorous note, I managed to stick an inline attachment as a piece of news in the admin panel (Admin => Main => News and Newsletters), suggesting (at least to me) that as long as the ILA tag has the message ID number, it SHOULDN'T matter if the message ID wasn't passed by the code to the parsing function.  I'd show the resulting picture of the news I "made", but I really don't want to offend anybody.....  (I think it's hilarious!)

Great! I am I am surprised at your own speed!
I am going to install a v5.4 in production site!

TY friend!


EDIT: v5.4 PERFECT WORK in production site!
Title: Re: Post and PM Inline Attachments
Post by: madskaizer on March 10, 2017, 03:19:06 PM
Hi Doug

I have this happening: http://www.simplemachines.org/community/index.php?topic=525705.msg3726671#msg3726671

SMF 2.0.13 and with these packages

1.    Anti Bot: Are You Human/Bot?    3.0    [ Uninstall ] [ List Files ] [ Delete ]
2.    Ohara YouTube Embed    1.2.8    [ Uninstall ] [ List Files ] [ Delete ]
3.    Mibbit Ajax IRC Chat Mod    2.1    [ Uninstall ] [ List Files ] [ Delete ]
4.    Pretty URLs    1.1.3    [ Uninstall ] [ List Files ] [ Delete ]
5.    Post and PM Inline Attachments    5.4    [ Uninstall ] [ List Files ] [ Delete ]
6.    Ad Managment    3.2    [ Uninstall ] [ List Files ] [ Delete ]
7.    SimplePortal    2.3.6    [ Uninstall ] [ List Files ] [ Delete ]
8.    Advanced Attachments Uploader    3.0
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 10, 2017, 03:49:57 PM
Oh yes..... It is not over yet  :-[

in reality I can not pick and load more than one attachment.

(more attachments) don't work.
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 11, 2017, 02:35:11 PM
I found the bug!

It's a number!   :laugh:     the number 7 in install_20x.xml at row434  put this 7 in post.template.php at row 485  :laugh:
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 11, 2017, 09:09:31 PM
Quote from: madskaizer on March 10, 2017, 03:19:06 PM
I have this happening: http://www.simplemachines.org/community/index.php?topic=525705.msg3726671#msg3726671

SMF 2.0.13 and with these packages

1.    Anti Bot: Are You Human/Bot?    3.0    [ Uninstall ] [ List Files ] [ Delete ]
2.    Ohara YouTube Embed    1.2.8    [ Uninstall ] [ List Files ] [ Delete ]
3.    Mibbit Ajax IRC Chat Mod    2.1    [ Uninstall ] [ List Files ] [ Delete ]
4.    Pretty URLs    1.1.3    [ Uninstall ] [ List Files ] [ Delete ]
5.    Post and PM Inline Attachments    5.4    [ Uninstall ] [ List Files ] [ Delete ]
6.    Ad Managment    3.2    [ Uninstall ] [ List Files ] [ Delete ]
7.    SimplePortal    2.3.6    [ Uninstall ] [ List Files ] [ Delete ]
8.    Advanced Attachments Uploader    3.0
If I had to take a guess, I'd say that it's a conflict between this mod and the Advanced Attachments Uploader.  It's a paid mod, so I will not be able to assist you with the conflict.....  See the PM I just sent you.

Quote from: LG965 on March 11, 2017, 02:35:11 PM
I found the bug!

It's a number!   :laugh:     the number 7 in install_20x.xml at row434  put this 7 in post.template.php at row 485  :laugh:
Thank you for pointing that out!!!  Removing that seems to solve the "(more attachment)" link not working issue....  I'm dealing with a brand new keyboard, which is a little more compact than my previous keyboard.  The 7 on the number pad is where the page down button was on my old keyboard.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 11, 2017, 10:14:46 PM
Uploaded v5.5 - March 11th, 2017
o Fixed "(more attachments)" issue.  Thanks, LG965 (http://www.simplemachines.org/community/index.php?action=profile;u=52327)!
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 12, 2017, 12:39:53 PM
BBC tag code again...

still does not work propertly with ILA string http://www.test.tuttovola.org/index.php?topic=7728.0
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 13, 2017, 10:13:08 AM
(https://tse3.mm.bing.net/th?id=OIP.2hEOM2OYdhYq9FvjA7PahgCpCW&pid=15.1&P=0&w=169&h=150)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 14, 2017, 06:46:05 AM
This mod and v3.3 of your Automatic Attachment Rotation mod won't play happily together.

I've got them both installed on a 2.0.13 system with no other mods and whenever I view posts with images I get lots of 'Undefined index' errors for thumb_hash, thumb_folder, thumb_name on line 1578 in ./Sources/Display.php

Line 1578:  $thumb_realname = getAttachmentFilename($attachment['thumb_name'], $attachment['id_thumb'], $attachment['thumb_folder'], false, $attachment['thumb_hash']);
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 14, 2017, 09:53:16 AM
@GL700Wing:  Thank you.  I'll look into this bug report.

@LG965:  Your bug report was fixed and your test server has the latest version.
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 14, 2017, 03:57:26 PM
Quote from: dougiefresh on March 14, 2017, 09:53:16 AM
@LG965:  Your bug report was fixed and your test server has the latest version.

Ok thank you, include it in the next release?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 14, 2017, 04:12:20 PM
Yeah,I'm including the fix for the next release.  Haven't gotten around to publishing it yet.  Maybe tomorrow....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 15, 2017, 03:38:20 PM
Uploaded v5.6 - March 15th, 2017
o Fixed regex expressions so that code & quote tags are processed correctly.




@LG965:  This update officially fixes the bug you reported.

@GL700Wing:  I'm still looking into your bug report.
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 15, 2017, 04:44:10 PM
Quite fast and accurate work as always!  ;)

but I have another one....   ;D

ILA and Image Floating to Left or Right BBCode don't working together.

Here   http://www.test.tuttovola.org/index.php?topic=7731.0
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 15, 2017, 05:46:12 PM
@LG965: Instead of using this:
[imgright][attachment id=1 msg=50317][/imgright]
Try this instead:
[attachment id=1 float=right msg=50317]
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 15, 2017, 06:01:44 PM
Oh yes this work correctly  ;) and know it.
Title: Re: Post and PM Inline Attachments
Post by: madskaizer on March 18, 2017, 09:16:26 AM
Just a warning to anyone that wants to use this lovely mod together with SMFPacks.com's Attachment Uploader

Quote from: NIBOGO SMFPacks CEO & founderI can't promise anything, but at the moment there is no integration planned between both mods.
#2 - March 12, 2017, 04:44:58 PM
Title: Re: Post and PM Inline Attachments
Post by: RGMears on March 18, 2017, 07:05:55 PM
I get many errors when trying to install v5.6 over v5.0. And when I try to uninstall v5.0 first I also get many errors. Another mod has placed code in between some of the v5.0 code and is causing the problem. If you would repost v5.0 on the mod page -- so it can be parsed -- I could likely resolve the uninstall errors.
Title: Re: Post and PM Inline Attachments
Post by: RGMears on March 19, 2017, 09:37:56 AM
I seem to be getting it to work: uninstall old, install current version (v5.6)
But, as others have said, the "insert attachment" does not work in WYSIWYG mode.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 19, 2017, 09:48:22 AM
Quote from: RGMears on March 19, 2017, 09:37:56 AM
I seem to be getting it to work: uninstall old, install current version (v5.6)
Sortable Packages (and Installed Time) (http://custom.simplemachines.org/mods/index.php?mod=2323) helps when uninstalling/upgrading mods....

Quote from: RGMears on March 19, 2017, 09:37:56 AM
But, as others have said, the "insert attachment" does not work in WYSIWYG mode.
It's a known issue....  It's one that I'm not sure I can fix....
Title: Re: Post and PM Inline Attachments
Post by: RGMears on March 19, 2017, 01:44:31 PM
Thanks for the link to the uninstall mod.

For whatever reason, attachments (images) inserted inline are still showing after the Message.
Title: Re: Post and PM Inline Attachments
Post by: RGMears on March 20, 2017, 03:55:45 AM
Fixed it. This line was missing from the alternate theme's Display.template.php:
if ($attachment['is_image'] && !empty($modSettings['attachmentShowImages']))
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 23, 2017, 09:14:42 AM
Hello Doug,

I have an idea for your mod, and semplify usage for user...

Look the attach

You can post me the code-modify and I put it in post.template.php

Ciao!
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 25, 2017, 11:16:06 AM
After a bit of copy and paste (I do not know to program  ::) ) almost I managed to get what I wanted.

I can not bring up "float right" from the second attachment onwards....

look attach and test here http://www.test.tuttovola.org/index.php?topic=7732.0

This is the part where I modified (start row 437 post.template.php)

//Start LG965 modify
// If this post already has attachments on it - give information about them.
if (!empty($context['current_attachments']))
{
echo '
<dl id="postAttachment">
<dt>
', $txt['attached'], ':
</dt>
<dd class="smalltext">
<input type="hidden" name="attach_del[]" value="0" />
', $txt['uncheck_unwatchd_attach'], ':
</dd>';
foreach ($context['current_attachments'] as $attid => $attachment)
echo '
<dd class="smalltext">
<label for="attachment_', $attachment['id'], '"><input type="checkbox" id="attachment_', $attachment['id'], '" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="input_check" /> ', $attachment['name'], ' <a onclick="insertAttachment(', ($attid + !empty($modSettings['ila_one_based_numbering'])), '); return false;">(', sprintf($txt['ila_insert'], ($attid  + !empty($modSettings['ila_one_based_numbering']))), ')</a> <a onclick="insertAttachment_float_right(', ($attid + !empty($modSettings['ila_one_based_numbering'])), '); return false;">(', sprintf($txt['ila_insert_float_right'], ($attid  + !empty($modSettings['ila_one_based_numbering']))), ')</a></label>

</dd>';
echo '
</dl>';
}

// Is the user allowed to post any additional ones? If so give them the boxes to do it! 
if ($context['can_post_attachment'])
{
echo '
<dl id="postAttachment2">
<dt>
', $txt['attach'], ':
</dt>
<dd class="smalltext">
<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a onclick="insertAttachment(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering'])), '); return false;">', sprintf($txt['ila_insert'], ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering']))),'</a>)
(<a onclick="insertAttachment_float_right(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering'])), '); return false;">', sprintf($txt['ila_insert_float_right'], ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering']))),'</a>)
(<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>) <a href="javascript:;" onClick="window.open(\'http://www.tuttovola.org/Themes/default/post_info_inserisci_allegato.html\', \'titolo\', \'width=500, height=500, resizable=yes, status=yes, scrollbars=1, location=yes\');">(info dim. pos.)</a>';

// Show more boxes only if they aren't approaching their limit.
if ($context['num_allowed_attachments'] > 1)
echo '
<script type="text/javascript"><!-- // --><![CDATA[
var allowed_attachments = ', $context['num_allowed_attachments'], ';
var current_attachment = ', (count($context['current_attachments']) + !empty($modSettings['ila_one_based_numbering'])), ';

function addAttachment()
{
allowed_attachments = allowed_attachments - 1;
current_attachment = current_attachment + 1;
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

var temp = "', $txt['ila_insert'], '";


temp = temp.replace("\%d", current_attachment);

setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a onclick="insertAttachment(\' + current_attachment + \'); return false;">\' + temp + \'</a>) (<a onclick="insertAttachment_float_right (\' + current_attachment + \'); return false;">\' + temp + \'</a>) (<a onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)\' + \'</dd><dd class="smalltext" id="moreAttachments"><a onclick="addAttachment(); return false;">(' . $txt['more_attachments'] . ')<\' + \'/a><\' + \'/dd>\');

return true;
}
// ]]></script>
</dd>
<dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a></dd>';

$ila_tag = (isset($modSettings['ila_insert_tag']) ? $modSettings['ila_insert_tag'] : 'attachment');
$ila_tag .= (empty($modSettings['ila_insert_format']) ? '=' : ' id=') . '\' + id + \'';
$ila_tag .= (!empty($modSettings['ila_insert_format']) && $modSettings['ila_insert_format'] == 2 ? ' msg=' . (isset($_REQUEST['msg']) ? $_REQUEST['msg'] : 'new') : '');

$ila_tag2 = (isset($modSettings['ila_insert_tag']) ? $modSettings['ila_insert_tag'] : 'attachment');
$ila_tag2 .= (empty($modSettings['ila_insert_format']) ? '=' : ' id=') . '\' + id + \'';
$ila_tag2 .= (!empty($modSettings['ila_insert_format']) && $modSettings['ila_insert_format'] == 2 ? ' width=250 float=right margin=20 msg=' . (isset($_REQUEST['msg']) ? $_REQUEST['msg'] : 'new') : '');

echo '
<dd class="smalltext">
<script type="text/javascript"><!-- // --><![CDATA[
function insertAttachment(id)
{', (file_exists($sourcedir . '/Subs-SCEditor.php') ? '
$(smfmod_editor).data(\'sceditor\').insertText(\'[' . $ila_tag . ']\');' : '
replaceText(\'[' . $ila_tag . ']\', document.forms.postmodify.' . $context['post_box_name'] . ');'), '
}

function insertAttachment_float_right(id)
{', (file_exists($sourcedir . '/Subs-SCEditor.php') ? '
$(smfmod_editor).data(\'sceditor\').insertText(\'[' . $ila_tag2 . ']\');' : '
replaceText(\'[' . $ila_tag2 . ']\', document.forms.postmodify.' . $context['post_box_name'] . ');'), '
}

// ]]></script>';
//End LG965 Modify



and a new row in InlineAttachment.english.php

$txt['ila_insert_float_right'] = 'float right';


The code that does work the first line is different from the next, and I can not do better.  :-\
Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 25, 2017, 03:37:11 PM
OK work!  :)

if you like you can put in the next release.



//Start LG965 modify
// If this post already has attachments on it - give information about them.
if (!empty($context['current_attachments']))
{
echo '
<dl id="postAttachment">
<dt>
', $txt['attached'], ':
</dt>
<dd class="smalltext">
<input type="hidden" name="attach_del[]" value="0" />
', $txt['uncheck_unwatchd_attach'], ':
</dd>';
foreach ($context['current_attachments'] as $attid => $attachment)
echo '
<dd class="smalltext">
<label for="attachment_', $attachment['id'], '"><input type="checkbox" id="attachment_', $attachment['id'], '" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="input_check" /> ', $attachment['name'], ' <a onclick="insertAttachment(', ($attid + !empty($modSettings['ila_one_based_numbering'])), '); return false;">(', sprintf($txt['ila_insert'], ($attid  + !empty($modSettings['ila_one_based_numbering']))), ')</a> <a onclick="insertAttachment_float_right(', ($attid + !empty($modSettings['ila_one_based_numbering'])), '); return false;">(', sprintf($txt['ila_insert_float_right'], ($attid  + !empty($modSettings['ila_one_based_numbering']))), ')</a></label>

</dd>';
echo '
</dl>';
}

// Is the user allowed to post any additional ones? If so give them the boxes to do it! 
if ($context['can_post_attachment'])
{
echo '
<dl id="postAttachment2">
<dt>
' , $txt['attach'], ': ' ,'<a href="javascript:;" onClick="window.open(\'http://www.tuttovola.org/Themes/default/post_info_inserisci_allegato.html\', \'titolo\', \'width=500, height=500, resizable=yes, status=yes, scrollbars=1, location=yes\')">', $txt['ila_insert_info'] ,'</a></dd>
</dt>
<dd class="smalltext">
<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a onclick="insertAttachment(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering'])), '); return false;">', sprintf($txt['ila_insert'], ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering']))),'</a>)
(<a onclick="insertAttachment_float_right(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering'])), '); return false;">', sprintf($txt['ila_insert_float_right'], ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering']))),'</a>)
(<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>) ';

// Show more boxes only if they aren't approaching their limit.
if ($context['num_allowed_attachments'] > 1)
echo '
<script type="text/javascript"><!-- // --><![CDATA[
var allowed_attachments = ', $context['num_allowed_attachments'], ';
var current_attachment = ', (count($context['current_attachments']) + !empty($modSettings['ila_one_based_numbering'])), ';

function addAttachment()
{
allowed_attachments = allowed_attachments - 1;
current_attachment = current_attachment + 1;
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

var temp = "', $txt['ila_insert'], '";
var temp2 = "', $txt['ila_insert_float_right'], '";

temp = temp.replace("\%d", current_attachment);

setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a onclick="insertAttachment(\' + current_attachment + \'); return false;">\' + temp + \'</a>) (<a onclick="insertAttachment_float_right (\' + current_attachment + \'); return false;">\' + temp2 + \'</a>) (<a onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)\' + \'</dd><dd class="smalltext" id="moreAttachments"><a onclick="addAttachment(); return false;">(' . $txt['more_attachments'] . ')<\' + \'/a><\' + \'/dd>\');

return true;
}
// ]]></script>
</dd>
<dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a></dd>';

$ila_tag = (isset($modSettings['ila_insert_tag']) ? $modSettings['ila_insert_tag'] : 'attachment');
$ila_tag .= (empty($modSettings['ila_insert_format']) ? '=' : ' id=') . '\' + id + \'';
$ila_tag .= (!empty($modSettings['ila_insert_format']) && $modSettings['ila_insert_format'] == 2 ? ' msg=' . (isset($_REQUEST['msg']) ? $_REQUEST['msg'] : 'new') : '');

$ila_tag2 = (isset($modSettings['ila_insert_tag']) ? $modSettings['ila_insert_tag'] : 'attachment');
$ila_tag2 .= (empty($modSettings['ila_insert_format']) ? '=' : ' id=') . '\' + id + \'';
$ila_tag2 .= (!empty($modSettings['ila_insert_format']) && $modSettings['ila_insert_format'] == 2 ? ' width=250 float=right margin=20 msg=' . (isset($_REQUEST['msg']) ? $_REQUEST['msg'] : 'new') : '');

echo '
<dd class="smalltext">
<script type="text/javascript"><!-- // --><![CDATA[
function insertAttachment(id)
{', (file_exists($sourcedir . '/Subs-SCEditor.php') ? '
$(smfmod_editor).data(\'sceditor\').insertText(\'[' . $ila_tag . ']\');' : '
replaceText(\'[' . $ila_tag . ']\', document.forms.postmodify.' . $context['post_box_name'] . ');'), '
}

function insertAttachment_float_right(id)
{', (file_exists($sourcedir . '/Subs-SCEditor.php') ? '
$(smfmod_editor).data(\'sceditor\').insertText(\'[' . $ila_tag2 . ']\');' : '
replaceText(\'[' . $ila_tag2 . ']\', document.forms.postmodify.' . $context['post_box_name'] . ');'), '
}

// ]]></script>';
//End LG965 Modify
// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.



two new row in InlineAttachment.english.php



$txt['ila_insert_float_right'] = 'float right';
$txt['ila_insert_info'] = 'read option info for inline post insert attachment';

Title: Re: Post and PM Inline Attachments
Post by: LG965 on March 25, 2017, 05:22:28 PM
I made small corrections to improve the code



//Start LG965 modify
// If this post already has attachments on it - give information about them.
if (!empty($context['current_attachments']))
{
echo '
<dl id="postAttachment">
<dt>
', $txt['attached'], ':
</dt>
<dd class="smalltext">
<input type="hidden" name="attach_del[]" value="0" />
', $txt['uncheck_unwatchd_attach'], ':
</dd>';
foreach ($context['current_attachments'] as $attid => $attachment)
echo '
<dd class="smalltext">
<label for="attachment_', $attachment['id'], '"><input type="checkbox" id="attachment_', $attachment['id'], '" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="input_check" /> ', $attachment['name'], ' <a onclick="insertAttachment(', ($attid + !empty($modSettings['ila_one_based_numbering'])), '); return false;">(', sprintf($txt['ila_insert'], ($attid  + !empty($modSettings['ila_one_based_numbering']))), ')</a> <a onclick="insertAttachment_float_right(', ($attid + !empty($modSettings['ila_one_based_numbering'])), '); return false;">(', sprintf($txt['ila_insert_float_right'], ($attid  + !empty($modSettings['ila_one_based_numbering']))), ')</a></label>

</dd>';
echo '
</dl>';
}

// Is the user allowed to post any additional ones? If so give them the boxes to do it! 
if ($context['can_post_attachment'])
{
echo '
<dl id="postAttachment2">
<dt>
' , $txt['attach'], ': ' ,'<font class="smalltext"><a href="javascript:;" onClick="window.open(\'/Themes/default/post_info_inserisci_allegato.html\', \'titolo\', \'width=500, height=500, resizable=yes, status=yes, scrollbars=1, location=yes\')">', $txt['ila_insert_info'] ,'</a></font>
</dt>
<dd class="smalltext">
<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a onclick="insertAttachment(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering'])), '); return false;">', sprintf($txt['ila_insert'], ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering']))),'</a>)
(<a onclick="insertAttachment_float_right(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering'])), '); return false;">', sprintf($txt['ila_insert_float_right'], ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering']))),'</a>)
(<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)</dd> ';

// Show more boxes only if they aren't approaching their limit.
if ($context['num_allowed_attachments'] > 1)
echo '
<script type="text/javascript"><!-- // --><![CDATA[
var allowed_attachments = ', $context['num_allowed_attachments'], ';
var current_attachment = ', (count($context['current_attachments']) + !empty($modSettings['ila_one_based_numbering'])), ';

function addAttachment()
{
allowed_attachments = allowed_attachments - 1;
current_attachment = current_attachment + 1;
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

var temp = "', $txt['ila_insert'], '";
var temp2 = "', $txt['ila_insert_float_right'], '";

temp = temp.replace("\%d", current_attachment);

setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a onclick="insertAttachment(\' + current_attachment + \'); return false;">\' + temp + \'</a>) (<a onclick="insertAttachment_float_right (\' + current_attachment + \'); return false;">\' + temp2 + \'</a>) (<a onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)\' + \'</dd><dd class="smalltext" id="moreAttachments"><a onclick="addAttachment(); return false;">(' . $txt['more_attachments'] . ')<\' + \'/a><\' + \'/dd>\');

return true;
}
// ]]></script>
</dd>
<dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a></dd>';

$ila_tag = (isset($modSettings['ila_insert_tag']) ? $modSettings['ila_insert_tag'] : 'attachment');
$ila_tag .= (empty($modSettings['ila_insert_format']) ? '=' : ' id=') . '\' + id + \'';
$ila_tag .= (!empty($modSettings['ila_insert_format']) && $modSettings['ila_insert_format'] == 2 ? ' msg=' . (isset($_REQUEST['msg']) ? $_REQUEST['msg'] : 'new') : '');

$ila_tag2 = (isset($modSettings['ila_insert_tag']) ? $modSettings['ila_insert_tag'] : 'attachment');
$ila_tag2 .= (empty($modSettings['ila_insert_format']) ? '=' : ' id=') . '\' + id + \'';
$ila_tag2 .= (!empty($modSettings['ila_insert_format']) && $modSettings['ila_insert_format'] == 2 ? ' width=250 float=right margin=20 msg=' . (isset($_REQUEST['msg']) ? $_REQUEST['msg'] : 'new') : '');

echo '
<dd class="smalltext">
<script type="text/javascript"><!-- // --><![CDATA[
function insertAttachment(id)
{', (file_exists($sourcedir . '/Subs-SCEditor.php') ? '
$(smfmod_editor).data(\'sceditor\').insertText(\'[' . $ila_tag . ']\');' : '
replaceText(\'[' . $ila_tag . ']\', document.forms.postmodify.' . $context['post_box_name'] . ');'), '
}

function insertAttachment_float_right(id)
{', (file_exists($sourcedir . '/Subs-SCEditor.php') ? '
$(smfmod_editor).data(\'sceditor\').insertText(\'[' . $ila_tag2 . ']\');' : '
replaceText(\'[' . $ila_tag2 . ']\', document.forms.postmodify.' . $context['post_box_name'] . ');'), '
}

// ]]></script>';
//End LG965 Modify
// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 28, 2017, 10:12:44 AM
@LG965:  I'm going to go a different route with the inline attachment GUI....  Unfortunately, the new stuff will be quite a bit more complicated than the current methodology....  Thanks for sharing, though! 
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 29, 2017, 06:49:47 AM
Encountered a couple of 'undefined index' errors when using this mod with Highslide 4 SMF (v 0.8.1) - fixes as follows:

In Subs-InlineAttachments.php:

Find
global $sourcedir, $settings, $modSettings, $context;

Replace with
global $sourcedir, $settings, $modSettings, $context, $msg;


Find
if (!isset($settings['hs4smf_slideshow']) && $settings['hs4smf_img_count'] > 1)

Replace with
if (!isset($settings['hs4smf_slideshow']) && $context['hs4smf_img_count'] > 1)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 29, 2017, 12:32:50 PM
@GL700Wing: Those fixes have been added for the next version.  Thank you for the fixes!
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 29, 2017, 05:46:02 PM
Quote from: dougiefresh on March 29, 2017, 12:32:50 PM
@GL700Wing: Those fixes have been added for the next version.  Thank you for the fixes!
You're welcome - any update on getting this mod to work with your Automatic Attachment Rotation (http://www.simplemachines.org/community/index.php?topic=525705.msg3918359#msg3918359) mod?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 30, 2017, 09:40:11 AM
Quote from: GL700Wing on March 29, 2017, 05:46:02 PM
You're welcome - any update on getting this mod to work with your Automatic Attachment Rotation (http://www.simplemachines.org/community/index.php?topic=525705.msg3918359#msg3918359) mod?
No, I haven't worked on it.  Sorry....
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 31, 2017, 05:43:20 AM
Quote from: dougiefresh on March 30, 2017, 09:40:11 AM
Quote from: GL700Wing on March 29, 2017, 05:46:02 PM
You're welcome - any update on getting this mod to work with your Automatic Attachment Rotation (http://www.simplemachines.org/community/index.php?topic=525705.msg3918359#msg3918359) mod?
No, I haven't worked on it.  Sorry....
No worries - I can see you've been busy with your other mods.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 14, 2017, 12:38:07 AM
Quote from: GL700Wing on March 14, 2017, 06:46:05 AM
This mod and v3.3 of your Automatic Attachment Rotation mod won't play happily together.

I've got them both installed on a 2.0.13 system with no other mods and whenever I view posts with images I get lots of 'Undefined index' errors for thumb_hash, thumb_folder, thumb_name on line 1578 in ./Sources/Display.php

Line 1578:  $thumb_realname = getAttachmentFilename($attachment['thumb_name'], $attachment['id_thumb'], $attachment['thumb_folder'], false, $attachment['thumb_hash']);
I decided today that I really do need this mod and the Automatic Attachment Rotation mod to work together without generating three 'Undefined index' errors every time an image is viewed so I've spent some time troubleshooting this issue and, thankfully, found the fix!

In ./Sources/Subs-InlineAttachments.php
Find:
thumb.width AS thumb_width, thumb.height AS thumb_height, m.id_topic
Add After:
, thumb.id_folder AS thumb_folder, thumb.file_hash AS thumb_hash, thumb.filename AS thumb_name

Happy days!!

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on June 17, 2017, 10:37:43 AM
@GL700Wing:  I apologize for my disappearance from the forum.  Other projects (and life itself) have conspired to keep me away....  The code change you suggested has been integrated into the next version....
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 17, 2017, 07:11:16 PM
Quote from: dougiefresh on June 17, 2017, 10:37:43 AM
@GL700Wing:  I apologize for my disappearance from the forum.  Other projects (and life itself) have conspired to keep me away....  The code change you suggested has been integrated into the next version....
Not a problem - fortunately I had some spare time - and a spare forum - to spend investigating the problem.
Title: Re: Post and PM Inline Attachments
Post by: Beowulf1976 on June 22, 2017, 09:21:12 AM
Whilst your mod is working,


It has completely and utterly borked the pm template

[photobucket thumbnails, please click to enlarge]
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi31.photobucket.com%2Falbums%2Fc358%2FBeowulf1976%2F1INIGO%2Fth_pmcapture01_zpssjioyrca.png&hash=11c79c82da823b8e2c2140197624c416) (http://s31.photobucket.com/user/Beowulf1976/media/1INIGO/pmcapture01_zpssjioyrca.png.html) (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi31.photobucket.com%2Falbums%2Fc358%2FBeowulf1976%2F1INIGO%2Fth_pmcapture02_zpswup7aqvw.png&hash=f0524c50a5544b69a1575a899862b936) (http://s31.photobucket.com/user/Beowulf1976/media/1INIGO/pmcapture02_zpswup7aqvw.png.html) (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi31.photobucket.com%2Falbums%2Fc358%2FBeowulf1976%2F1INIGO%2Fth_pmcapture03_zpsokvlpeyw.png&hash=ae768c2c9ddf1e661634ac942d194221) (http://s31.photobucket.com/user/Beowulf1976/media/1INIGO/pmcapture03_zpsokvlpeyw.png.html)

Not only has it put the pm send button right up there, the entire pm template is half the screen it should be, and it's just a mess

I'm hoping that someone can help me fix it because it looks utterly horrible. :'(

(I would prefer that I didn't receive any negative comments about the content and amount of smilies on the posting template, thank you)

Thank you in advance
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 05, 2017, 02:45:23 PM
I think I'm finally back....  I'm looking into this bug report!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 05, 2017, 06:22:34 PM
Uploaded v5.7 - July 5th, 2017
o Fixed 2 undefined index errors found by GL700Wing (http://www.simplemachines.org/community/index.php?action=profile;u=112942).  Thanks, GL700Wing!
o Resolved undefined array element errors coming from Automatic Attachment Rotation (http://custom.simplemachines.org/mods/index.php?mod=4087) mod.  Thanks, GL700Wing (http://www.simplemachines.org/community/index.php?action=profile;u=112942)!!




@GL700Wing:  Thank you for the bug reports!  I apologize for taking so long in order to make them public, but public they are now!

@Beowulf1976:  I just got back from a movie and dinner with the wife, and I installed both mods on a clean 2.0.14 forum.  I'm not seeing the issue you are.  (Image attached is what I'm seeing)  The fact that you appear to have a portal and/or chatbox installed makes me suspect it as the cause of your issue(s) that you are reporting....  Can you uninstall the portal/chatbox and see if that either of those are the source of your issue?
Title: Re: Post and PM Inline Attachments
Post by: aegersz on July 06, 2017, 07:26:27 AM
here is another conflict (your mod) with this mod, if you don't mind ...

https://www.simplemachines.org/community/index.php?topic=550923.msg3931756#msg3931756
Title: Re: Post and PM Inline Attachments
Post by: Beowulf1976 on July 07, 2017, 11:50:37 AM
Quote from: dougiefresh on July 05, 2017, 06:22:34 PM
@Beowulf1976:  I just got back from a movie and dinner with the wife, and I installed both mods on a clean 2.0.14 forum.  I'm not seeing the issue you are.  (Image attached is what I'm seeing)  The fact that you appear to have a portal and/or chatbox installed makes me suspect it as the cause of your issue(s) that you are reporting....  Can you uninstall the portal/chatbox and see if that either of those are the source of your issue?

Simple Portal (which included the chat box) is not the issue, on testing thoroughly I have found that it is This Mod (https://custom.simplemachines.org/mods/index.php?mod=1974)

I uninstalled your Post and PM Inline Attachments mod to test whether it was this mod, and it still showed to be borked, so it is the above mod that is causing the borked pm system :( Unfortunately - which is usually the case of luck for me, I cannot simply uninstall it as it has many errors. *sigh* All I can do is "Disable attachments" within the PM settings section, which I assume renders that part of your mod useless :( (unless your mod enables the ability to send attachments in pm separately)

Thank you and I am sorry for not first checking prior to posting a bug report *sigh*

EDIT: Obviously "Disable All Attachments" within the PM Attachments menu does stop your mod from working (the pm part) but it does fix the issue with my borked looking pm's.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 07, 2017, 02:19:15 PM
@Beowulf1976: Well, I'm happy to hear that you've isolated the problem to a specific mod.  Even happier that the problem mod isn't this one!

That leaves the whole issue of the PM Attachments mod....  Sigh...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 07, 2017, 02:47:20 PM
UPDATE:  I was trying to update this mod for SMF 2.1 Beta 3, when I discovered that the new beta has some form of inline attachment code included!  Makes me wonder if I should continue updating this mod for SMF 2.1 Beta 3....  In any case, I will have to figure out how to integrate my functionality with the SMF 2.1 Beta 3's, or just completely replace their functionality with my own....  Worse case will be to leave their functionality in place and stop development for SMF 2.1 Beta 3.....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 08, 2017, 12:04:02 PM
Uploaded v5.8 - July 8th, 2017
o Updated source code for SMF 2.1 Beta 1 & 2.  Templates are still unedited.
o Remvoed support for SMF 2.1 Beta 1 & 2.
o Attempt fix for issue where incomplete information was pulled for attachments.




@aegersz:  This update should (hopefully) solve the issues you reported between this mod and the Play Media Attachments (http://custom.simplemachines.org/mods/index.php?mod=4131) mod.  You MAY need the updated Play Media Attachments (http://custom.simplemachines.org/mods/index.php?mod=4131) mod, as well....

@Beowulf1976:  I haven't looked any further into your bug report yet....
Title: Re: Post and PM Inline Attachments
Post by: @rjen on July 11, 2017, 04:47:13 AM
I am using you mod now, and it works nicely, but I have two 'issues'

Forumversion 2.0.14
PHP version: 7.1

Issue Number 1:
Every time I access the admin section for Inline attachments I get en error in the log:

Quote8: Undefined index: ila_one_based_numbering
Bestand: /home/deb77453/domains/fjr-club.nl/public_html/Sources/Subs-InlineAttachmentsAdmin.php
Regel: 132

The source code involved is this:


129: function askNumber()
130: {
131: var now_renumber = document.getElementById("ila_one_based_numbering").checked ? 1 : 0;
==>132: if (now_renumber != ' . $modSettings['ila_one_based_numbering'] . ')
133: document.getElementById("renumber_attachment_tags").value = (confirm("' . $txt['ila_one_based_numbering_ask'] . '") ? 1 : 0);
134: else


Issue Number 2:
I cannot seem to get two attachments showing next to each other: the attachment information seems to break the alignment, is there a solution for this?

If I deactivate the 'Download link and counter setting:' in admin it works, but when I activate it I get below display
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 11, 2017, 10:06:11 AM
@rjen:  I've fixed issue number 1 for the next version.  I'll look into issue number 2 and see what I can do....
Title: Re: Post and PM Inline Attachments
Post by: Beowulf1976 on July 11, 2017, 09:23:22 PM
Quote from: dougiefresh on July 07, 2017, 02:19:15 PM
@Beowulf1976: Well, I'm happy to hear that you've isolated the problem to a specific mod.  Even happier that the problem mod isn't this one!

That leaves the whole issue of the PM Attachments mod....  Sigh...

Eeep, I am sorry :(

I've pm'd you on your own forum btw. :)

Best wishes
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on July 12, 2017, 12:25:24 AM
Quote from: Beowulf1976 on July 11, 2017, 09:23:22 PM
Eeep, I am sorry :(

I've pm'd you on your own forum btw. :)
No worries.  PM Attachment mod is one I'm going to have to look at sooner than later....  Replied on XPtsp.com forum.
Title: Re: Post and PM Inline Attachments
Post by: albertlast on August 27, 2017, 01:31:35 AM
In Subs-InlineAttachment i found IFNULL,
like mention in another thread i recommend to use COALESCE instead.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 31, 2017, 11:27:44 AM
Uploaded v5.9 - August 31st, 2017
o Completed SMF 2.1 Beta 3 template edits.  Javascript edits still needed.
o Replaced IFNULL with COALESCE in database queries for better Postgres support.




@albertlast:  I had made the changes a while ago, but hadn't uploaded the new mod.  Those changes are in this version.  Thanks for noticing!

UPDATE:  Here is what I've figured out about SMF 2.1 Beta 3's attachment posting stuff.  It looks like SMF 2.1 Beta 3 is virtually identical to SMF 2.0.x's Post template code.  The only difference is the Javascript that replaces the "SMF 2.0.x-ish" interface with a drag-and-drop/picture-preview interface.  So I've still got to figure out how to modify the Javascript to add the "insert attachment" option that SMF 2.0.x has beside the uploaded attachments....
Title: Re: Post and PM Inline Attachments
Post by: darkmoon2010 on September 04, 2017, 12:01:25 PM
Hi,
we are using your excellent Mod in our forum and it works very good.

Only one issue requested by our users, when they attach a picture and klick on the preview button, before saving the article, thy can be only seen [Invalid Attachment] instead of the picture. When they press the save button everything looks fine.

Do you have any idea, how this could be solved ?

Forumversion 2.0.14
PHP version: 5.5.9
Post and PM Inline Attachments   5.9



Best regards
Thomas

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 04, 2017, 07:12:26 PM
Quote from: darkmoon2010 on September 04, 2017, 12:01:25 PM
Only one issue requested by our users, when they attach a picture and klick on the preview button, before saving the article, thy can be only seen [Invalid Attachment] instead of the picture. When they press the save button everything looks fine.
I know for sure that I will not be able to do anything with the PHP code, as the attachment verification and handling is done MUCH MUCH farther down than the preview request will ever get....  I MIGHT be able to do something with Javascript, but only if I can get the fully qualified pathname from the input buttons....
Title: Re: Post and PM Inline Attachments
Post by: pellet_newb on September 05, 2017, 06:28:05 PM
Can I get an example of [attachment][/attachment] with a width parameter?  Does attachment overwrite the width?  I've tried attach as well  [attach=1 width=500][/attach] and it does not work.  Thanks
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 06, 2017, 08:50:47 PM
Quote from: pellet_newb on September 05, 2017, 06:28:05 PM
Can I get an example of [attachment][/attachment] with a width parameter?  Does attachment overwrite the width?  I've tried attach as well  [attach=1 width=500][/attach] and it does not work.  Thanks
I looked at the code briefly and didn't find a reference to the width function.  I admit I may have overlooked something....  Let me investigate....
Title: Re: Post and PM Inline Attachments
Post by: pellet_newb on September 07, 2017, 11:26:55 AM
See attached.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 07, 2017, 11:25:07 PM
Quote from: dougiefresh on September 06, 2017, 08:50:47 PM
Quote from: pellet_newb on September 05, 2017, 06:28:05 PM
Can I get an example of [attachment][/attachment] with a width parameter?  Does attachment overwrite the width?  I've tried attach as well  [attach=1 width=500][/attach] and it does not work.  Thanks
I looked at the code briefly and didn't find a reference to the width function.  I admit I may have overlooked something....  Let me investigate....
Quote from: pellet_newb on September 07, 2017, 11:26:55 AM
See attached.
Yeah, I know what the documentation says.  I wrote it!  Geez....  So let me clarify what I meant (since it doesn't seem obvious): I didn't see the reference to the width parameter in the CODE that builds the HTML used to display the picture.  I also told you I'd investigate.  Bothering me about your bug report so soon doesn't help me at all, unless you've got something to contribute....
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 08, 2017, 08:56:07 PM
Uploaded v5.10 - September 8th, 2017
o Fixed the HTML building code so various parameters work properly.
o Fixed undefined array element error in Subs-InlineAttachments.php.




@pellet_newb:  I installed the mod on a clean localhost forum and managed to duplicate your bug report, but only when the attach tag is used with an image that has a thumbnail generated.  I traced it to the SMF-styled HTML code branch and it was missing the style portion of the statement.  Including it has fixed the issue (at least for me)!  Hopefully, this update fixes the bug report you posted!  Thank you!
Title: Re: Post and PM Inline Attachments
Post by: pellet_newb on September 12, 2017, 12:30:24 PM
Thanks @dougiefresh, what about Tapatalk support?  Here is a screen shot of what our inline attachments looks like in Tapatalk:
Title: Re: Post and PM Inline Attachments
Post by: aegersz on September 13, 2017, 01:50:50 AM
@dougie, i noticed that you handle pdf files in some way (was looking at the settings) but i have attached both pdf and text files but there was no display unlike your picture processing.

I don't know if that is contingent on the browser too.

I would REALLY love to have an embedded PDF and text viewer process the attachment inline.

is that possible ?
Title: Re: Post and PM Inline Attachments
Post by: Parmaster on September 13, 2017, 07:12:24 AM
Hi!

I Installed successfully your mod, but I can't insert an attachment. I see the links but when I click on it nothing happens.

And in PM's it's not possible to send an attachment.

And why is in every PHP file which the mod edited this CDATA? It seems that there is a failure with editing the files. Or doesn't it affect anything?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 14, 2017, 11:32:39 AM
Quote from: aegersz on September 13, 2017, 01:50:50 AM
@dougie, i noticed that you handle pdf files in some way (was looking at the settings) but i have attached both pdf and text files but there was no display unlike your picture processing.
Evidentally, Google has changed their software so that you HAVE to be logged in in order to view a PDF document.  I am going to change the code to use an embed or object HTML tag, which may require the user to have Adobe Reader installed on the system....

Quote from: Parmaster on September 13, 2017, 07:12:24 AM
I Installed successfully your mod, but I can't insert an attachment. I see the links but when I click on it nothing happens.
Hmmmmm.....  Let me look into this.

Quote from: Parmaster on September 13, 2017, 07:12:24 AM
And in PM's it's not possible to send an attachment.
This mod doesn't give the forum the ability to sent PM attachments, but enhances the PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974) mod to allow you to insert the attachment into the message, much like using the img tag.

Quote from: Parmaster on September 13, 2017, 07:12:24 AM
And why is in every PHP file which the mod edited this CDATA? It seems that there is a failure with editing the files. Or doesn't it affect anything?
Huh?
Title: Re: Post and PM Inline Attachments
Post by: pellet_newb on September 14, 2017, 11:37:26 AM
What about Tapatalk support?
Title: Re: Post and PM Inline Attachments
Post by: Parmaster on September 14, 2017, 11:41:53 AM
@dougiefresh:

don't worry, I solved it. I don't know if it's related to the theme I use or SMF directly, but it only works if WYSIWYG is off (in my forum).

Ah ok, then I have to look about this mod.

It wasn't your mod alone that included the CDATA crap into the files, I saw many of them also in other files in which your mod haven't changed anything, so something is broken and I don't know what.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 14, 2017, 11:51:18 AM
Quote from: pellet_newb on September 14, 2017, 11:37:26 AM
What about Tapatalk support?
Still looking into it.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on September 15, 2017, 11:41:51 PM
Quote from: pellet_newb on September 14, 2017, 11:37:26 AM
What about Tapatalk support?
UPDATE:  My forum is now online with Tapatalk, so I can now do testing with it to try to make it work with this mod.
Title: Re: Post and PM Inline Attachments
Post by: pellet_newb on September 17, 2017, 07:31:01 PM
Quote from: dougiefresh on September 15, 2017, 11:41:51 PM
Quote from: pellet_newb on September 14, 2017, 11:37:26 AM
What about Tapatalk support?
UPDATE:  My forum is now online with Tapatalk, so I can now do testing with it to try to make it work with this mod.

SWEET, fingers crossed!
Title: Re: Post and PM Inline Attachments
Post by: pellet_newb on September 26, 2017, 11:33:49 AM
Have you made any progress with Tapatalk?  Thanks
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 02, 2017, 01:03:47 AM
Found an issue that results in the wrong error message (ie, '] Invalid Attachment [' instead of '[ Attachment has not been uploaded yet ]') being displayed when previewing either a new or modified message that includes a new inline attachment.  Fixed by moving a slightly modified preview message test to before the permissions tests.

Also, suggest that test for determining if attachments can be viewed is done at very beginning so that 'ila_nopermission' message is displayed instead of 'ila_invalid' message.

In /.Sources/Subs-InlineAttachments.php

Find:
function ILA_Build_HTML(&$tag, &$id)
{
global $context, $modSettings, $settings, $txt, $sourcedir, $user_info, $smcFunc, $forum_version;

// If the "one-based numbering" option is set, subtract 1 from the attachment ID to make it compatible:
$id = $id - intval(!empty($modSettings['ila_one_based_numbering']));

// Make sure that we can access other messages:
$allowed = (isset($modSettings['ila_allow_quoted_images']) && !empty($modSettings['ila_allow_quoted_images']) && !file_exists($sourcedir . '/Subs-Tapatalk.php'));
if (isset($context['ila_params']['msg']))
$msg = ($allowed || (isset($context['ila']['msg']) && $context['ila_params']['msg'] == $context['ila']['msg']) ? $context['ila_params']['msg'] : -1);
else
$msg = (isset($context['ila']['msg']) ? $context['ila']['msg'] : -1);

// Are attachments enabled and can we see them?  If not, return no permission message:
if (!isset($context['ila']['attachments'][$msg][$id]))
return $txt['ila_invalid'];
$attachment = &$context['ila']['attachments'][$msg][$id];
if (empty($context['ila']['pm_attach']) && empty($modSettings['attachmentEnable']))
return $txt['ila_nopermission'];
if (!empty($context['ila']['pm_attach']) && (empty($modSettings['pmAttachmentEnable']) || empty($context['ila']['pm_view_attachments'])))
return $txt['ila_nopermission'];

// This part is done after board permission check because we don't want to give user false hope.
// If we are previewing the post, return "attachment not uploaded yet" message:
if (!isset($context['ila']['attachments'][$msg]) && (isset($_REQUEST['action']) ? $_REQUEST['action'] : '') == 'post2')
return $txt['ila_not_uploaded'];


Replace With:
function ILA_Build_HTML(&$tag, &$id)
{
global $context, $modSettings, $settings, $txt, $sourcedir, $user_info, $smcFunc, $forum_version;

// Are we allowed to view attachments?  If not, return no permission message
if (!allowedTo('view_attachments'))
return $txt['ila_nopermission'];

// If the "one-based numbering" option is set, subtract 1 from the attachment ID to make it compatible:
$id = $id - intval(!empty($modSettings['ila_one_based_numbering']));

// Make sure that we can access other messages:
$allowed = (isset($modSettings['ila_allow_quoted_images']) && !empty($modSettings['ila_allow_quoted_images']) && !file_exists($sourcedir . '/Subs-Tapatalk.php'));
if (isset($context['ila_params']['msg']))
$msg = ($allowed || (isset($context['ila']['msg']) && $context['ila_params']['msg'] == $context['ila']['msg']) ? $context['ila_params']['msg'] : -1);
else
$msg = (isset($context['ila']['msg']) ? $context['ila']['msg'] : -1);

// If we are previewing the post, return "attachment not uploaded yet" message:
if (((isset($_REQUEST['action']) ? $_REQUEST['action'] : '') == 'post2') && (!isset($context['ila']['attachments'][$msg][$id])))
return $txt['ila_not_uploaded'];

// Are attachments enabled and can we see them?  If not, return no permission message:
if (!isset($context['ila']['attachments'][$msg][$id]))
return $txt['ila_invalid'];
$attachment = &$context['ila']['attachments'][$msg][$id];
if (empty($context['ila']['pm_attach']) && empty($modSettings['attachmentEnable']))
return $txt['ila_nopermission'];
if (!empty($context['ila']['pm_attach']) && (empty($modSettings['pmAttachmentEnable']) || empty($context['ila']['pm_view_attachments'])))
return $txt['ila_nopermission'];

// This part is done after board permission check because we don't want to give user false hope.


Also, found a bug in 5.10 that is not present in 5.6 whereby a new attachment is not inserted inline when an existing message is modified - it is only attached (see attachments).
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 18, 2017, 11:41:41 PM
Uploaded v5.11 - October 18th, 2017
o Modified code to return already-build attachment context array if available.
o Fixed reporting invalid attachment when viewing attachments on board wasn't possible.




@GL700Wing:  Thanks for reporting those bugs. 

The suggested code change would solve the immediate issue of the message, but it wouldn't solve this particular scenario: On a board where viewing attachments isn't possible, a message containing an inline attachment tag, which referrs to an attachment on a board where viewing attachments is allowed, would not be viewable, despite the fact that it is viewable on that board.  I've fixed the code in several spots to fix the whole issue on order to deal with the scenario specified.....

Quote from: GL700Wing on October 02, 2017, 01:03:47 AM
Also, found a bug in 5.10 that is not present in 5.6 whereby a new attachment is not inserted inline when an existing message is modified - it is only attached (see attachments).
Okay, that's weird....  I'll have to look into this bug report....

Quote from: pellet_newb on September 26, 2017, 11:33:49 AM
Have you made any progress with Tapatalk?  Thanks
@pellet_newb: I wish I could say that I have definitely made some progress, however, I THINK I've fixed an issue that keeps from reporting the attachments correctly to the Tapatalk script....  I haven't have time to test it against Tapatalk code, though....

I strongly suspect that since the Tapatalk mod does it's own parsing before and after called SMF's parsing function, that it is somehow messing up the attachments.  Not sure, though....
Title: Re: Post and PM Inline Attachments
Post by: @rjen on October 19, 2017, 09:06:09 AM
Nice work, I was just wondering: did you ever find time to look into the incorrect presentation thing I reported before when two attachments are posted side by side? I tried finding a solution myself, but I was not successfull...

Quote from: @rjen on July 11, 2017, 04:47:13 AM
Issue Number 2:
I cannot seem to get two attachments showing next to each other: the attachment information seems to break the alignment, is there a solution for this?

If I deactivate the 'Download link and counter setting:' in admin it works, but when I activate it I get below display
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 19, 2017, 11:01:20 AM
Quote from: @rjen on October 19, 2017, 09:06:09 AM
Nice work, I was just wondering: did you ever find time to look into the incorrect presentation thing I reported before when two attachments are posted side by side? I tried finding a solution myself, but I was not successfull...

Quote from: @rjen on July 11, 2017, 04:47:13 AM
Issue Number 2:
I cannot seem to get two attachments showing next to each other: the attachment information seems to break the alignment, is there a solution for this?

If I deactivate the 'Download link and counter setting:' in admin it works, but when I activate it I get below display
The only thing I've come up with for this is to use the float=left parameter in the inline attachment tag for both tags.....  The biggest problem that I can see with this solution is if text is involved, as floating the image to the left or right may screw with the intented appearance.....

You could also try a table declaration, surrounding each image with the [tr] tags.....

Quote from: GL700Wing on October 02, 2017, 01:03:47 AM
Also, found a bug in 5.10 that is not present in 5.6 whereby a new attachment is not inserted inline when an existing message is modified - it is only attached (see attachments).
Issue confirmed with version 5.11.
Title: Re: Post and PM Inline Attachments
Post by: @rjen on October 19, 2017, 11:16:37 AM
Problem is that I Cannot find where to do that...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 19, 2017, 01:20:23 PM
Insert float=left just after the id parameter.  That should work....
Title: Re: Post and PM Inline Attachments
Post by: @rjen on October 19, 2017, 01:29:54 PM
Can you tell me what file the dit needs to be in?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 19, 2017, 08:42:53 PM
In the message that you are inlining an attachment.  Change something like this:
Code (Starting Example) Select
[attachment id=1 msg=1234]
to something like this:
Code (Change to) Select
[attachment id=1 float=left msg=1234]
Title: Re: Post and PM Inline Attachments
Post by: @rjen on October 20, 2017, 02:58:14 AM
Quote from: dougiefresh on October 19, 2017, 08:42:53 PM
In the message that you are inlining an attachment.  Change something like this:
Code (Starting Example) Select
[attachment id=1 msg=1234]
to something like this:
Code (Change to) Select
[attachment id=1 float=left msg=1234]

That does the trick indeed, thanks! I was hoping for a more 'permanent'  fix though.

I now notice that when I include this float statement within the [ attachment ] code, an additional < div > is generated under the < inner > div.
This  div is what I was looking for: <div style="float: left;">

Without the style added into the attachment statement this div is not even generated, so there is nothing to influence from css.
Is there a way to always generate this div with the style so users will not have to manually type this additional float?
Title: Re: Post and PM Inline Attachments
Post by: @rjen on October 20, 2017, 05:05:21 AM
Quote from: @rjen on October 20, 2017, 02:58:14 AM
I now notice that when I include this float statement within the [ attachment ] code, an additional < div > is generated under the < inner > div.
This  div is what I was looking for: <div style="float: left;">

Without the style added into the attachment statement this div is not even generated, so there is nothing to influence from css.
Is there a way to always generate this div with the style so users will not have to manually type this additional float?

mmm, I just realized the float is not ideal, because it would make all text float around the inline attachments permanently.
It would probably be better to have a standard <div> around the img and text defined as inline-block?
Title: Re: Post and PM Inline Attachments
Post by: @rjen on October 20, 2017, 07:59:03 AM
I managed to make the change myself!
This fix does exactly what I was looking for: it by default creates the < div > as an inline-block, but when a float is used it works as a floated div. This way when a user puts three attachments on one line they will nicely show on the line without the text issues I highlighted. On smaller screens the divs are positioned below each other if needed.

You may want to include this in your next update as well?

In file: Subs-InlineAttachments.php

Find:
// Add the margin and float params to the rest of the HTML:
if (isset($context['ila_params']['float']) && $context['ila_params']['float'] == 'center')


Replace with:
// Add the margin and float params to the rest of the HTML:
if (!isset($context['ila_params']['float']))
$html = '<div style="display: inline-block;">' . $html . '</div>';
elseif (isset($context['ila_params']['float']) && $context['ila_params']['float'] == 'center')


See attachments...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 20, 2017, 11:18:18 AM
Hmmm.....  Code seems to work well enough, but I made another change to ensure other CSS style stuff gets included as well.  Here is that block of code:
// Add the margin and float params to the rest of the HTML:
if (isset($context['ila_params']['float']) && $context['ila_params']['float'] == 'center')
$html = '<div style="margin-left: auto; margin-right: auto; display: block;">' . $html . '</div>';
elseif (isset($context['ila_params']['float']))
$html = '<div style="display: inline-block; float: ' . $context['ila_params']['float'] . ';' . (!empty($style) ? $style : '') . '">' . $html . '</div>';
elseif (!empty($style))
{
if ((!empty($modSettings['ila_download_count']) && $tag['tag'] != 'attachmini') || $tag['tag'] == 'attachurl')
$html = '<div style="display: inline-block; ' . (!empty($style) ? $style : '') . '">' . $html . '</div>';
else
$html = str_replace('<img src="', '<img style="' . $style . '" src="', $html);
}
else
$html = '<div style="display: inline-block;">' . $html . '</div>';

It will be included in the next version of the mod!  Thanks, @rjen!
Title: Re: Post and PM Inline Attachments
Post by: @rjen on October 20, 2017, 03:05:25 PM
Updated, looking forward to next version...  ;)
Title: Re: Post and PM Inline Attachments
Post by: jakes_t on November 03, 2017, 06:24:09 AM
Great mod!

I've read through most of the thread but couldn't find anything related to the 2 bugs(?) I encountered:

1. Clicking (more attachments) to add another attachment, but leaving the browse box empty (ie, not adding another file) then clicking post gives a blank screen.
(https://s1.postimg.org/9lsy68m2fz/cap1.jpg)

2. Feature or bug, I'm not sure - When editing a post to add more inline pics it will attach the next picture on the bottom as an attachment again. You have to the edit again a second time then go "insert attachment" then only does it go inline?

Installed mods:

1.    Avatars on Board/MessageIndex    
2.    Show JDALLAUI in Post and PM    
3.    Post and PM Inline Attachments    
4.    Resize Attached Images    2.4.1

Thanks!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 13, 2017, 11:25:40 AM
@jakes_t: I will look into bug #1, as nobody else has reported that one.  Bug #2 is known and no solution has been found yet.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 14, 2017, 04:12:50 AM
Quote from: dougiefresh on November 13, 2017, 11:25:40 AM
Bug #2 is known and no solution has been found yet.
I found a solution for this just now when I discovered that copying ./Sources/Subs-InlineAttachments.php from v5.6 fixed the problem.

I then discovered that making the following change in ./Sources/Subs-InlineAttachments.php from v5.11 also fixed the problem:
Find:
// Fetch attachments for use in "parse_bbc" function...
if (!isset($attachments[$msg_id]))
{

Replace With:
// Fetch attachments for use in "parse_bbc" function...

Find:
}

// Load the attachment context even if there are no attachments:

Replace With:


// Load the attachment context even if there are no attachments:


This change effectively reinstates the same code that was used in this section in v5.6 (although "unset($attachments[$msg_id])" was used in v5.6 and "$attachments[$msg_id] = array();" is used in v5.11) but obviously you will need to determine if this solution is appropriate or if it breaks something else ... :)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 14, 2017, 06:18:39 AM
I think I've found another bug ...

I have an SMF 2.0.14 forum with no other mods installed except forv5.11 of this mod (without any code changes made) and whenever I select a 'Download link and counter setting' of either 'Filename only', 'Filename and Size' or 'Filename, Size and Dimensions' (ie, either the second, third or fourth option from the drop-down list) all of the image details are displayed (ie, Filename, Size, Dimensions and Count) below the image.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 14, 2017, 07:52:21 AM
Quote from: GL700Wing on November 14, 2017, 06:18:39 AM
I think I've found another bug ...

I have an SMF 2.0.14 forum with no other mods installed except forv5.11 of this mod (without any code changes made) and whenever I select a 'Download link and counter setting' of either 'Filename only', 'Filename and Size' or 'Filename, Size and Dimensions' (ie, either the second, third or fourth option from the drop-down list) all of the image details are displayed (ie, Filename, Size, Dimensions and Count) below the image.

I've think I've worked out the fix for this bug too ... :)

In ./Sources/Subs-InlineAttachments.php
Find:
($download_count ? ($download_count >= 5 ? '<br/>' : ' ') . '(' . $attachment['size'] . ($attachment['is_image'] && !empty($dimensions['width']) ? ' - ' . $dimensions['width'] . 'x' . $dimensions['height'] . ($download_count == 6 ? ')<br/>(' : ' - ') . $viewed : ' - ' . $downloaded) . ')' : '').
Replace With:
($download_count ? (($download_count >= 5 ? '<br/>' : ' ') . ($download_count >= 2 ? '(' . $attachment['size'] : '') . ($download_count >= 3 && $attachment['is_image'] && !empty($dimensions['width']) ? ', ' . $dimensions['width'] . 'x' . $dimensions['height'] : '') . ($download_count >= 4 ? (($download_count == 6 ? ')<br/>(' : ' - ') . ($attachment['is_image'] ? $viewed : ' - ' . $downloaded)) : '') . ($download_count >= 2 ? ')' : '')) : '') .

Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 14, 2017, 11:02:36 AM
Uploaded v5.12 - November 14th, 2017
o Modified code to enclose ILA tag with "display: inline-block" CSS style, based on @rjen's code snipet. (https://www.simplemachines.org/community/index.php?topic=525705.msg3945482#msg3945482).
o Fixed attachment not inline after editing post, per GL700Wing's instructions (https://www.simplemachines.org/community/index.php?topic=525705.msg3947759#msg3947759).
o Fixed download link/counter code for display, per GL700Wing's instructions (https://www.simplemachines.org/community/index.php?topic=525705.msg3947786#msg3947786).




@rjen and GL700Wing:  Thank you for finding and correcting the code fragments that were the source of the bugs that you found.  I apologize for not being around lately.  Life has been kicking me lately, but I'm fighting back (like normal)....

Quote from: GL700Wing on November 14, 2017, 04:12:50 AM
This change effectively reinstates the same code that was used in this section in v5.6 (although "unset($attachments[$msg_id])" was used in v5.6 and "$attachments[$msg_id] = array();" is used in v5.11) but obviously you will need to determine if this solution is appropriate or if it breaks something else ... :)
I was trying to prevent an unnecessary database call with that if...then statement.  It looks like it really was a necessary call to make...

Quote from: jakes_t on November 03, 2017, 06:24:09 AM
1. Clicking (more attachments) to add another attachment, but leaving the browse box empty (ie, not adding another file) then clicking post gives a blank screen.
I'm still trying to find the time to look into this bug report.  I apologize for any inconvenience....
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 14, 2017, 08:01:40 PM
Quote from: dougiefresh on November 14, 2017, 11:02:36 AM
@rjen and GL700Wing:  Thank you for finding and correcting the code fragments that were the source of the bugs that you found.  I apologize for not being around lately.  Life has been kicking me lately, but I'm fighting back (like normal)....
You're welcome - happy to help when I can.
Title: Re: Post and PM Inline Attachments
Post by: pellet_newb on November 18, 2017, 10:43:04 AM
Any luck with Tapatalk support?  Thanks
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on November 28, 2017, 12:11:08 PM
Uploaded v5.13 - November 26th, 2017
o Added support for the Tapatalk mod.
o Fixed undefined variable error when HS4SMF mod is installed and enabled.




@pellet_newb:  Sorry about the wait.  It's been frustrating trying to figure out why Tapatalk doesn't seem to respond to my changes, but I discovered that Tapatalk uses a modified set of source files instead of the core source files.  I am able to modify those so that Tapatalk support works (I think...).  Let me know if more needs to be done.  Thanks!
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 29, 2017, 11:51:49 PM
After installing this mod trying to insert a PM attachment inline doesn't work - clicking on 'Insert Attachment X' does nothing.

In order for inline PM attachments to work the installation of the 'Post and PM Inline Attachments' mod needs to replace of the some code in PersonalMessage.template.php that was added by the 'PM Attachments' mod.  However, and even though the operation fails for two blocks of code the installation for PersonalMessage.template.php shows as 'Test successful' because the two failed operations are set to 'Ignore Errors' (you don't see these messages if all other tests pass and you don't expand the twistie for PersonalMessage.template.php).

The first of the failing 'Replace' operations in ./Themes/default/PersonalMessage.template.php should be as follows (the search was not looking for href="javascript:void(0);" but I don't know if it should still be there after the replace):
Find:
function addAttachment()
{
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="38" name="attachment

[]" class="input_file" /><\' + \'/dd><dd class="smalltext" id="moreAttachments"><a href="javascript:void(0);" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\');

allowed_attachments = allowed_attachments - 1;

return true;
}

Replace:
var current_attachment = ', (isset($context['current_attachments']) ? count($context['current_attachments']) : 0) + !empty($modSettings['ila_one_based_numbering']), ';

function addAttachment()
{
current_attachment = current_attachment + 1;
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

var temp = "', $txt['ila_insert'], '";
temp = temp.replace("\%d", current_attachment);
setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment

[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a onclick="insertAttachment(\' + current_attachment + \'); return false;">\' + temp + \'</a>) (<a onclick="cleanFileInput(\\\'attachment\' +

current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)\' + \'</dd><dd class="smalltext" id="moreAttachments"><a onclick="addAttachment(); return false;">(' . $txt['more_attachments'] . ')<\' + \'/a><\' +

\'/dd>\');

allowed_attachments = allowed_attachments - 1;

return true;
}


The second of the failing 'Replace' operations in ./Themes/default/PersonalMessage.template.php should be as follows (it was failing because of the number of tab characters it was searching for and it also added the comment on the last line twice):
Find:
echo '
<dd class="smalltext">';

// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.


Replace:
$ila_tag = (isset($modSettings['ila_insert_tag']) ? $modSettings['ila_insert_tag'] : 'attachment');
$ila_tag .= (empty($modSettings['ila_insert_format']) ? '=' : ' id=') . '\' + id + \'';
$ila_tag .= (!empty($modSettings['ila_insert_format']) && $modSettings['ila_insert_format'] == 2 ? ' msg=' . (isset($_REQUEST['msg']) ? $_REQUEST['msg'] : 'new') : '');
echo '
<dd class="smalltext">
<script type="text/javascript"><!-- // --><![CDATA[
function insertAttachment(id)
{', (file_exists($sourcedir . '/Subs-SCEditor.php') ? '
$(smfmod_editor).data(\'sceditor\').insertText(\'[' . $ila_tag . ']\');' : '
replaceText(\'[' . $ila_tag . ']\', document.forms.postmodify.' . $context['post_box_name'] . ');'), '
}
// ]]></script>';

// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.



Also, the operation that always fails in ./Sources/ManageAttachments.php when PM attachments has already been installed could be avoided by changing it from a 'Before' action to an 'After' action as follows:
Find:

'removeall' => 'RemoveAllAttachments'

Add After:
,
'ila' => 'ILA_Admin_Settings'



After I'd made the changes above I had inline PM attachments working but I then discovered images are always displayed as unapproved attachments (eg, with opacity set to 40%) and they are still shown below the message as an attachment even if the option 'Remove attachment image under post after in-post use?' is checked/ticked for posts.  Also, if only the standard SMF viewer is available (ie, neither HS4SMF, Highslide Image Viewer or jQLightbox are installed) clicking on the image does nothing.  To fix all these issues I made the following changes to ./Sources/Subs-InlineAttachments.php

The following code change enables PM attachments to be displayed inline without any opacity.
Find:
$style = (empty($attachment['is_approved']) ? 'opacity: ' . ($style / 100) . '; filter: alpha(opacity=' . $style . ');' : '');
Replace:
$style = (empty($attachment['is_approved']) && !$context['ila']['pm_attach'] ? 'opacity: ' . ($style / 100) . '; filter: alpha(opacity=' . $style . ');' : '');


The following code change stops inline attachments also being displayed below the PM text if the option 'Remove attachment image under post after in-post use?' is checked/ticked for posts.
Find:
// Return to our lord and saviour, our caller! :p
return $html;

Add Before
if (!empty($modSettings['ila_duplicate']) && $context['ila']['pm_attach'])
$context['ila']['dont_show'][$attachment['id']] = true;




The following code change allows inline images in a PM attachment to be downloaded when the image is clicked.
Find:
return '<img src="' . $full . ';image" ' . ' alt="' . $name . '"' . ' class="bbc_img resized' . (!empty($class) ? ' ' . $class : '') . '"' . $style .' />';
Replace:
return '<a href="' . $full . '"><img src="' . $full . ';image" ' . ' alt="' . $name . '"' . ' class="bbc_img resized' . (!empty($class) ? ' ' . $class : '') . '"' . $style .' />';



Finally, I cam across a bit of code that may be redundant in  ./Sources/Subs-InlineAttachments.php.
On line 955 'has_thumb' is set to false when the function is defined:
function ILA_subfunction($id, $full, $thumb, $name, $style = '', $has_thumb = false, $expand = true)

However, further down in same function (line 991) there is a test for 'has_thumb' that may be redundant  because it's doesn't get changed once the function has been called ...
if ($has_thumb)

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 30, 2017, 03:06:13 AM
I discovered another minor bug with this mod - there is no option to clear/remove the first attachment when composing a new message (the option to clear an attachment is only displayed for the second and subsequent attachments).

In the mod installer file for ./Themes/default/PersonalMessage.template.php:

Find:
<search position="replace"><![CDATA[<input type="file" size="38" name="attachment[]" class="input_file" />';]]></search>
<add><![CDATA[<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a onclick="insertAttachment(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering'])), '); return false;">', sprintf($txt['ila_insert'], ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering']))),'</a>)';]]></add>


Replace:
<search position="replace"><![CDATA[<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)';]]></search>
<add><![CDATA[<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a onclick="insertAttachment(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering'])), '); return false;">', sprintf($txt['ila_insert'], ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering']))),'</a>) (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)';]]></add>


Note:  This fix assumes the issue of not being to clear any attachments (https://www.simplemachines.org/community/index.php?topic=331969.msg3950098#msg3950098) in the 'PM Attachments' mod has also been fixed.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 30, 2017, 05:26:56 AM
Quote from: GL700Wing on November 29, 2017, 11:51:49 PM
Finally, I came across a bit of code that may be redundant in  ./Sources/Subs-InlineAttachments.php.
...
Ignore this comment - I figured out what it is for and how it works :)

Last find for today ...

I couldn't get 'attachthumb' to display a non-expandable thumbnail - all it would display was the name of the image and clicking on it just caused a spinning pointer.  I got it working by making the following changes in ./Sources/Subs-InlineAttachments.php:
Find:
// AttachThumb => Show thumbnail ONLY, not expandable
function ILA_tag_attachthumb(&$info, &$dim, $has_thumb, $style)
{
$data = &$info;
if (!empty($info['thumbnail']['has_thumb']))
$dim = array('width' => $info['width'], 'height' => $info['height'], 'img' => $info['href']);
else
$dim = array('width' => $info['real_width'], 'height' => $info['real_height']);
return ILA_subfunction($info['id'], $dim['href'], $dim['href'], $info['name'], $style, $has_thumb);
}


Replace:
// AttachThumb => Show thumbnail ONLY, not expandable
function ILA_tag_attachthumb(&$info, &$dim, $has_thumb, $style)
{
$data = &$info;
$image = ($expand = !empty($info['thumbnail']['has_thumb'])) ? $info['thumbnail']['href'] : $info['href'];
if (!empty($info['thumbnail']['has_thumb']))
$dim = array('width' => $info['width'], 'height' => $info['height'], 'img' => $info['href']);
else
$dim = array('width' => $info['real_width'], 'height' => $info['real_height']);
$expand = false;
return ILA_subfunction($info['id'], $info['href'], $image, $info['name'], $style, $has_thumb, $expand);
}

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on December 04, 2017, 05:56:26 AM
Quote from: dougiefresh on November 28, 2017, 12:11:08 PM
Uploaded v5.13 - November 26th, 2017
o Added support for the Tapatalk mod.
o Fixed undefined variable error when HS4SMF mod is installed and enabled.




@pellet_newb:  Sorry about the wait.  It's been frustrating trying to figure out why Tapatalk doesn't seem to respond to my changes, but I discovered that Tapatalk uses a modified set of source files instead of the core source files.  I am able to modify those so that Tapatalk support works (I think...).  Let me know if more needs to be done.  Thanks!
The version of ./Sources/Subs-InlineAttachmentsAdmin.php included with v5.13 still wont allow the option "Allow quoted attachment images from another post?" to be selected if Tapatalk - the option is greyed out which means the checkbox cannot be selected.

The following changes need to be made in ./Sources/Subs-InlineAttachmentsAdmin.php:
Delete the following (lines 67 & 68 in v5.13):
if ($tapatalk = file_exists($sourcedir . '/Subs-Tapatalk.php'))
$modSettings['ila_allow_quoted_images'] = 0;


Find:
array('check', 'ila_allow_quoted_images', ($tapatalk ? 'disabled' : 99) => true),
Replace:
array('check', 'ila_allow_quoted_images'),
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on December 05, 2017, 04:17:04 AM
Another couple of changes required in ./Sources/Subs-InlineAttachmentsAdmin.php to enable inline quoted images to be displayed when Tapatalk is displayed:
Find:
Quoteif (empty($modSettings['ila_allow_quoted_images']) || empty($msg) || file_exists($sourcedir . '/Subs-Tapatalk.php'))
Replace:
Quoteif (empty($modSettings['ila_allow_quoted_images']) || empty($msg))

Find:
Quote$allowed = (isset($modSettings['ila_allow_quoted_images']) && !empty($modSettings['ila_allow_quoted_images']) && !file_exists($sourcedir . '/Subs-Tapatalk.php'));
Replace:
Quote$allowed = (isset($modSettings['ila_allow_quoted_images']) && !empty($modSettings['ila_allow_quoted_images']));
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 05, 2017, 09:41:37 AM
Good Lord, man!  You've been quite the busy beaver, finding and fixing things....  I'm having trouble keeping up!  O:)  I'll incorporate these changes as soon as I can....
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on December 05, 2017, 11:56:32 PM
Quote from: dougiefresh on December 05, 2017, 09:41:37 AM
Good Lord, man!  You've been quite the busy beaver, finding and fixing things....  I'm having trouble keeping up!  O:)  I'll incorporate these changes as soon as I can....
I wasn't quite done with this mod but I wasn't sure I could solve the last issue I'd found as it involved another mod (Custom View of Attachments) which is no longer available from this site (although it can still be downloaded from the developer's website (https://dragomano.ru/mods/custom-view-of-attachments)).   ;)

The issue was that if only *some* image attachments were inserted inline they were *all* shown as thumbnails in the attachment area at the bottom of the message.

Fortunately the fix is fairly simple to implement and requires two changes to ./Sources/Subs-CustomView.php:
Find:
loadLanguage('CustomView');

if (!empty($modSettings['custom_view_attachments']))


Replace:
loadLanguage('CustomView');

$msg_id = $message['id'];
if (!empty($modSettings['custom_view_attachments']))



Find:
if (!isset($context['ila_dont_show_attach_below']) || !array_key_exists($attachment['id'], $context['ila_dont_show_attach_below']))
{


Replace:
if (empty($context['ila']['dont_show'][$attachment['id']]) && ((!isset($context['ila_dont_show_attach_below']) || !array_key_exists($attachment['id'], $context['ila_dont_show_attach_below']))))
{
// Skip over already displayed inline attachments:
if (!empty($context['ila']['dont_show'][$msg_id][$attachment['id']]))
continue;



Think I'm done now ...  :D
Note:  The Post and PM Inline Attachments mod already makes part of the second change - the bit about skipping over already displayed inline attachments needs to be added.


PS:  I also did a bit of work on PM Attachments (https://www.simplemachines.org/community/index.php?topic=331969.msg3950084#msg3950084)
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 08, 2017, 07:57:37 PM
Uploaded v6.0 - December 8th, 2017
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3950088#msg3950088) Fixed issue where inserting a PM attachment inline doesn't work.
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3950088#msg3950088) Fixed issue where inline PM attachments were being displayed as unapproved.
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3950088#msg3950088) Fixed install issue with PM Attachments mod regarding ManageAttachments.php.
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3950088#msg3950088) Fixed issue where inline PM attachments are shown again under PM text.
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3950088#msg3950088) Fixed issue where inline PM attachments can't be downloaded.
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3950101#msg3950101) Fixed issue where no option to clear/remove the first attachment when composing a new message.
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3950109#msg3950109) Fixed issue where [attachthumb] is an expandable thumbnail.
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3950802#msg3950802) Fixed issue so that inline attachments can be quoted in Tapatalk.
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3950933#msg3950933) Fixed another issue code so that inline attachments can be quoted in Tapatalk.
o Per GL700Wing: (https://www.simplemachines.org/community/index.php?topic=525705.msg3951094#msg3951094) Fixed issue with Custom Attachment View mod where all attachments are shown.
o Copied mime detection code from my Play Media Attachments (http://custom.simplemachines.org/mods/index.php?mod=4131) mod.




@GL700Wing:  Thank you for all the bug reports and fixes!  They have been included in this version!
Title: Re: Post and PM Inline Attachments
Post by: @rjen on December 11, 2017, 03:02:34 PM
Just uninstalled version 5.12 and installed 6.0. Now when I go to the admin section for Inline attachments this error shows..

syntax error, unexpected ''removeall'' (T_CONSTANT_ENCAPSED_STRING), expecting ')'

The error log is quickly filling with errors:

https://test.fjr-club.nl/index.php?action=admin;area=manageattachments;sa=ila;acf1bfd273=7876e56ab0d4bec7eefaf281b85d2dc9
8: Undefined index: description
Bestand: /home/deb77453/domains/fjr-club.nl/public_html/test/Themes/default/GenericMenu.template.php
Regel: 303

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on December 11, 2017, 03:49:51 PM
I think that's my fault - I've just realised that in a suggestion I made in an earlier post I got the 'before' and 'after' positions around the wrong way.

It should have been:
Also, the operation that always fails in ./Sources/ManageAttachments.php when PM attachments has already been installed could be avoided by changing it from a 'after' action to an 'before' action as follows:
Find:

'removeall' => 'RemoveAllAttachments'

Add After:
,
'ila' => 'ILA_Admin_Settings'
Title: Re: Post and PM Inline Attachments
Post by: @rjen on December 11, 2017, 03:53:33 PM
I would hope the mod author has checked the suggestions made before incorporating them in the package? I'll wait for the next update and will try again.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 11, 2017, 04:17:01 PM
Dammit, I dropped the ball on testing it....  I'll fix it tonight after work.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 15, 2017, 02:41:04 PM
Uploaded v6.1 - December 15th, 2017
o Fixed installer where ILA actions are inserted.
Title: Re: Post and PM Inline Attachments
Post by: jakes_t on December 22, 2017, 01:25:42 PM
Thanks for your efforts with this. May I ask what will happen when 2.1 gets released? Would 2.1 be able to handle posts made with this mod?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 22, 2017, 05:21:46 PM
This mod is designed to work with both SMF 2.0.x and SMF 2.1 Beta 3.  Once you upgrade to SMF 2.1 Final, you will need to install this mod on that install.  Once you do, this mod SHOULD work like before....  But I will customize the mod per SMF 2.1 install to make sure it installs correctly....
Title: Re: Post and PM Inline Attachments
Post by: @rjen on December 27, 2017, 05:11:42 PM
Just noticed that since the last update whenever someone clicks on a regular attached image (so not even placed inline) below error messages gets written to the log...

https://www.fjr-club.nl/index.php?action=dlattach;topic=14573.0;attach=10488
8: Use of undefined constant file_ext - assumed 'file_ext'
Bestand: /home/deb77453/domains/fjr-club.nl/public_html/Sources/Display.php
Regel: 1443

I suspect it is caused by this mod, correct?

The line itself is:
   elseif (ILA_Mime_Type($filename, file_ext, $mime_type))
Title: Re: Post and PM Inline Attachments
Post by: @rjen on December 30, 2017, 08:56:22 AM
Ok, changing this code

   elseif (ILA_Mime_Type($filename, file_ext, $mime_type))

to this

   elseif (ILA_Mime_Type($filename, $file_ext, $mime_type))

solves the problem.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on December 30, 2017, 11:42:07 AM
Uploaded v6.2 - December 18th, 2017
o Fixed errors generated by NULL being was passed to in_array function.
o Fixed code fragment using ILA_mime_type in Display.php.




@@rjen:  Thank you for reporting the bug!  It's been fixed for this version!
Title: Re: Post and PM Inline Attachments
Post by: @rjen on December 30, 2017, 12:46:45 PM
Quote from: dougiefresh on December 30, 2017, 11:42:07 AM
Uploaded v6.2 - December 18th, 2017
o Fixed errors generated by NULL being was passed to in_array function.
o Fixed code fragment using ILA_mime_type in Display.php.




@@rjen:  Thank you for reporting the bug!  It's been fixed for this version!


Installing version 6.2 on my test site results in HTTP ERROR 500
Title: Re: Post and PM Inline Attachments
Post by: BellGab.com on January 07, 2018, 02:18:14 AM
Quote from: @rjen on December 30, 2017, 12:46:45 PM
Quote from: dougiefresh on December 30, 2017, 11:42:07 AM
Uploaded v6.2 - December 18th, 2017
o Fixed errors generated by NULL being was passed to in_array function.
o Fixed code fragment using ILA_mime_type in Display.php.




@@rjen:  Thank you for reporting the bug!  It's been fixed for this version!


Installing version 6.2 on my test site results in HTTP ERROR 500

same here.
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 07, 2018, 04:21:06 AM
I didn't catch the exact error before manually uninstalling in a hurry, but my browser told me the server wouldn't respond...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 07, 2018, 10:23:09 PM
Uploaded v6.3 - January 7th, 2018
o Fixed coding syntax error in Subs-InlineAttachments.php.




@Everybody:  Hopefully this fixes the bug reports that have been reported....
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 08, 2018, 02:09:29 AM
Ooh thanks, will try it later today hopefully :)
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 13, 2018, 10:50:38 AM
Hello!

So I installed it, it installed fine, but when users (others reported it, too) click on "insert attachment" nothing happened...

Any idea where to start checking? No entries appear in the log...

Thanks!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 14, 2018, 08:41:45 PM
I'll look into this bug (again)....
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 15, 2018, 12:42:17 AM
Cheers, let me know if I can help in any way to debug.
Title: Re: Post and PM Inline Attachments
Post by: bharat on January 18, 2018, 09:38:45 AM
Can you please explain me how does this mod work? I unstalled it on my forum but don't see any option to insert attachment, where should it be?
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 18, 2018, 09:50:59 AM
Next to the attachment button, though it does nothing in my case...
Title: Re: Post and PM Inline Attachments
Post by: bharat on January 18, 2018, 10:21:08 AM
I can see it but if I click on it nothing happen that's why I was wondering maybe I am doing something wrong.
Title: Re: Post and PM Inline Attachments
Post by: bharat on January 18, 2018, 10:22:35 AM
Actually I am getting this message all the time: [ Attachment has not been uploaded yet ]
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 18, 2018, 12:20:30 PM
I'm not getting that message; the message itself is weird because the attachment is not uploaded till you hit Post, am I wrong?

Otherwise, hitting 'insert' does indeed nothing.
Title: Re: Post and PM Inline Attachments
Post by: bharat on January 19, 2018, 02:55:30 AM
Somehow if you click on insert attachment and then post message the picture appear in the message.
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 19, 2018, 05:31:24 AM
*IN* the message, or as an attachment?

In my forum, it does the latter...
Title: Re: Post and PM Inline Attachments
Post by: bharat on January 19, 2018, 05:33:32 AM
Picture is in the message as an attachment.
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 19, 2018, 05:47:52 AM
Not helping :D Is it inline, within the message body, or an attachment?

Maybe it's me who doesn't understand it... maybe a screenshot would help?
Title: Re: Post and PM Inline Attachments
Post by: skb on January 19, 2018, 06:14:49 AM
Yes, "Insert Attachment" will insert the attachment within the message body.
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 19, 2018, 06:42:04 AM
Then you're luckier than I am :D
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 19, 2018, 08:43:55 PM
@Everybody:  There is a new version of PM Attachments uploaded.  It is currently incompatible with version 6.3 and below.
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 20, 2018, 02:58:56 AM
What does 'incompatible' mean in this case? What is going to be lost?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 21, 2018, 10:11:16 PM
Quote from: Gryzor on January 20, 2018, 02:58:56 AM
What does 'incompatible' mean in this case?
Right now, you can't install the newest version of PM attachment, then EASILY install versions 6.3 and below onto your forum.  You should wait for the next version, which will take care of the incompatibility....  You also could manually adapt the changes in this mod to get things working; however, we all know how much of a pain THAT is....

Quote from: Gryzor on January 20, 2018, 02:58:56 AM
What is going to be lost?
Nothing.  The new PM attachments mod update has taken care of missing functionality (see this post (https://www.simplemachines.org/community/index.php?topic=331969.msg3958388#msg3958388) for update details).  Versions 6.3 and below of this mod simply cannot install over that mod, due to the changes that have been made.
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 22, 2018, 05:12:52 AM
Oh, so if I read this correctly it breakd upwards compatibility, but backwards compatibility is ok. Well, as long as it works fine, I guess that's fine :)
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 22, 2018, 05:14:05 AM
Btw, the mod page lists v6.3 of 08/01/08 as the last one? Is this the one you're referring to in your post from 20/01?
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 29, 2018, 04:14:10 AM
Hello!

Where can I find the newer, >6.3 version?

Thanks!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on January 29, 2018, 10:15:48 AM
@Gryzor:  It hasn't been uploaded yet.
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on January 29, 2018, 12:32:51 PM
Ohh and here I was F5'ing every day to check :D Thanks for the clarification!
Title: Re: Post and PM Inline Attachments
Post by: aegersz on February 04, 2018, 03:11:33 PM
I still don't have any automatic embedding of pdf files

I have no error messages and see nothing in the developer tools so i wonder if anything is wrong at my end ?

no big deal but would be nice to have.
Title: Re: Post and PM Inline Attachments
Post by: RaveN7 on February 08, 2018, 05:43:28 PM
Sometimes, after adding a picture as an attachment, the whole text below it becomes a hyperlink. Clicking the text (or the picture) downloads the picture instead of displaying it in a full size :o

How can i fix that?
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 17, 2018, 06:45:09 AM
While testing Post and PM Inline Attachments V6.3 I discovered a few issues which I resolved as follows:

As per the changes I made to ./Sources/Subs-InlineAttachments.php (https://www.simplemachines.org/community/index.php?topic=525705.msg3950088#msg3950088) a separate array is required for messages and PMs so they can be displayed inline.
Find:
// Mark ONLY approved attachments as "don't show" if admin has checked that option:
if (!empty($modSettings['ila_duplicate']) && (!empty($attachment['is_approved']) || !empty($context['ila']['pm_attach'])))
$context['ila']['dont_show'][$msg][$attachment['id']] = true;


Replace with:
// Mark ONLY approved attachments as "don't show" if admin has checked that option:
if (!empty($modSettings['ila_duplicate']) && !empty($attachment['is_approved']))
$context['ila']['dont_show'][$msg][$attachment['id']] = true;

if (!empty($modSettings['ila_duplicate']) && $context['ila']['pm_attach'])
$context['ila']['dont_show'][$attachment['id']] = true;





As per the changes I made to ./Sources/Subs-InlineAttachments.php (https://www.simplemachines.org/community/index.php?topic=525705.msg3950109#msg3950109) the code for 'ILA_tag_attachthumb' needs updating.
Find
// AttachThumb => Show thumbnail ONLY, not expandable
function ILA_tag_attachthumb(&$info, &$dim, $has_thumb, $style)
{
$data = &$info;
if (!empty($info['thumbnail']['has_thumb']))
$dim = array('width' => $info['width'], 'height' => $info['height'], 'img' => $info['href']);
else
$dim = array('width' => $info['real_width'], 'height' => $info['real_height']);
return ILA_subfunction($info['id'], $dim['href'], $dim['href'], $info['name'], $style, $has_thumb, false);
}


Replace with:
// AttachThumb => Show thumbnail ONLY, not expandable
function ILA_tag_attachthumb(&$info, &$dim, $has_thumb, $style)
{
$data = &$info;
$image = ($expand = !empty($info['thumbnail']['has_thumb'])) ? $info['thumbnail']['href'] : $info['href'];
if (!empty($info['thumbnail']['has_thumb']))
$dim = array('width' => $info['width'], 'height' => $info['height'], 'img' => $info['href']);
else
$dim = array('width' => $info['real_width'], 'height' => $info['real_height']);
$expand = false;
return ILA_subfunction($info['id'], $info['href'], $image, $info['name'], $style, $has_thumb, $expand);
}





The following code added to install_20x.xml will integrate Post and PM Inline Attachments with the PM Attachments v2.9.  It will also display the option to clear/remove the second and subsequent attachments when composing a new message.

<operation error="ignore">
<search position="replace"><![CDATA[echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![', 'CDATA', '[
var allowed_attachments = ', $context['num_allowed_attachments'], ' - 1;
var current_attachment = 1;

function addAttachment()
{
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

allowed_attachments = allowed_attachments - 1;
current_attachment = current_attachment + 1;

setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="38" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)<\' + \'/dd>\' + (allowed_attachments > 0 ? \'<dd class="smalltext" id="moreAttachments"><a href="javascript:void(0);" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\' : \'\'));

return true;
}
// ', ']', ']></script>
</dd>
<dd class="smalltext" id="moreAttachments"><a href="javascript:void(0);" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a></dd>';
]]></search>
<add><![CDATA[echo '
<script type="text/javascript"><!-- // --><![', 'CDATA', '[
var allowed_attachments = ', $context['num_allowed_attachments'], ';
var current_attachment = ', (isset($context['current_attachments']) ? count($context['current_attachments']) : 0) + !empty($modSettings['ila_one_based_numbering']), ';

function addAttachment()
{
allowed_attachments = allowed_attachments - 1;
current_attachment = current_attachment + 1;
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

var temp = "', $txt['ila_insert'], '";
temp = temp.replace("\%d", current_attachment);
setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a onclick="insertAttachment(\' + current_attachment + \'); return false;">\' + temp + \'</a>) (<a onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)\' + \'</dd><dd class="smalltext" id="moreAttachments"><a onclick="addAttachment(); return false;">(' . $txt['more_attachments'] . ')<\' + \'/a><\' + \'/dd>\');

return true;
}
// ', ']', ']></script>
</dd>
<dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a></dd>';
]]></add>
</operation>



The following code change in install_20x.xml adds a space to each side of 'ila_tag' which allows consecutive inline images to wrap as required when displayed.
Find:
$(smfmod_editor).data(\'sceditor\').insertText(\'[' . $ila_tag . ']\');' : '
replaceText(\'[' . $ila_tag . ']\', document.forms.postmodify.' . $context['post_box_name'] . ');'), '


Replace with:
$(smfmod_editor).data(\'sceditor\').insertText(\' [' . $ila_tag . '] \');' : '
replaceText(\' [' . $ila_tag . '] \', document.forms.postmodify.' . $context['post_box_name'] . ');'), '
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 17, 2018, 11:25:15 AM
Uploaded v6.4 - February 17th, 2018
o Implemented GL700Wing (https://www.simplemachines.org/community/index.php?action=profile;u=112942)'s fixes, as shown here (https://www.simplemachines.org/community/index.php?topic=525705.msg3962266#msg3962266).




@GL700Wing:  I just can't keep up with everything lately....  Thank you for sharing your fixes!  They have been included in this version!
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on February 17, 2018, 01:16:22 PM
Thanks for the update!

Unfortunately, for me clicking on "Insert Attachment" still does nothing :(

2.0.15...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 17, 2018, 02:38:25 PM
Quote from: Gryzor on February 17, 2018, 01:16:22 PM
Thanks for the update!

Unfortunately, for me clicking on "Insert Attachment" still does nothing :(

2.0.15...
In posts or PMs?
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on February 17, 2018, 02:56:31 PM
Sorry, posts. I don't use it with PMs.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 17, 2018, 06:04:49 PM
@Gryzor:  GAAAH!!!!  I knew I forgot something.....
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 17, 2018, 06:57:45 PM
Quote from: dougiefresh on February 17, 2018, 06:04:49 PM
@Gryzor:  GAAAH!!!!  I knew I forgot something.....
I'm wondering if @Gryzor has a conflicting mod that is blocking the 'Insert Attachment' functionality - I have this mod installed on an SMF 2.0.15 forum that has 135 mods (plus a lot of other customisation) and it's working properly.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on February 17, 2018, 09:39:30 PM
Just tested version 6.4 on a pretty clean localhost forum.  Works fine for me as well!
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 18, 2018, 01:49:49 AM
Quote from: dougiefresh on February 17, 2018, 11:25:15 AM
@GL700Wing:  I just can't keep up with everything lately....  Thank you for sharing your fixes!  They have been included in this version!
Should have mentioned there were two place in install_20x.xml that needed the following change (one for Post.template.php and one for PersonalMessage.template.php).

The following code change in install_20x.xml adds a space to each side of 'ila_tag' which allows consecutive inline images to wrap as required when displayed.
Find:
$(smfmod_editor).data(\'sceditor\').insertText(\'[' . $ila_tag . ']\');' : '
replaceText(\'[' . $ila_tag . ']\', document.forms.postmodify.' . $context['post_box_name'] . ');'), '


Replace with:
$(smfmod_editor).data(\'sceditor\').insertText(\' [' . $ila_tag . '] \');' : '
replaceText(\' [' . $ila_tag . '] \', document.forms.postmodify.' . $context['post_box_name'] . ');'), '
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on February 18, 2018, 02:39:06 AM
Hm, so maybe it's something else... but, any idea how to troubleshoot it? Any ideas? Used to work just fine up to (I think) 6.2 or so...

Thanks for the mod and updates, btw :)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 18, 2018, 06:58:40 AM
Quote from: Gryzor on February 18, 2018, 02:39:06 AM
Hm, so maybe it's something else... but, any idea how to troubleshoot it? Any ideas? Used to work just fine up to (I think) 6.2 or so...
I suspect it's caused by a JavaScript conflict - can you post a list of the mods you have installed?

Also, do you know if auto-suggest is working? For example: when composing a PM and once you've typed three characters in the 'To' field you should see a list of possible matches displayed that you can select from.  Some years ago auto-suggest stopped working on my forum and it was caused by some issue in the JavaScript code of a mod I'd installed - as soon as I removed the mod auto-suggest started working again.
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on February 18, 2018, 11:07:27 AM
That sounded like a good suggestion. Autocomplete works fine in my case though...

Here's my list of mods; this time I've kept it rather light :D

1.Mod NameVersion1.Enhancements to purge inactive members1.3.6 
2.Sorted Package Manager Listing1.2 
3.SEO Sitemap2.2.1 
4.RSS Feed Icon1.1 
5.Gravatar 4 SMF1.1 
6.SA Chat1.0a1 Rev120 
7.Bookmarks2.5 
8.Akismet Spam Blocking2.0 
9.Tapatalk SMF 2.0 Plugin4.4.1 
10.Post and PM Inline Attachments6.4 
11.SMFPacks Alerts Pro2.0.14 
12.Simple Off-Topic BBC1.0 
13.Pretty URLs1.1.4 
14.Recent Topics On Board Index1.03 
15.SMFPacks Mentions1.4.4 
16.Treasury2.12 
17.Expanding & Collapsing Spoiler Tag3.2 
18.SMFPacks Likes Pro Mod2.0.7 
19.WYSIWYG Quick Reply2.3 
20.SMF 2.0.15 Update1.0 
21.SMFPacks Media Embedder1.0.3 
22.Google Analytics Code1.5.1 
23.SMF Downloads Directory1.2.3 
24.Country Flags3.0 

Title: Re: Post and PM Inline Attachments
Post by: jakes_t on February 28, 2018, 06:20:25 PM
Working nicely for me now on this version. All the bugs I reported are no longer an issue  :)
Title: Re: Post and PM Inline Attachments
Post by: Diadu on March 01, 2018, 08:46:09 AM
I've tried out the mod today. At first glance it seemed to work fine for me. The images appear, as expected, inside the posts.

The problem I am facing is when one clicks on the images or the download link itself. Clicking on either redirects me to the URL of the attachment with an error:

http ://*/index.php?action=dlattach;topic=14.0;attach=20
Fatal error: Call to undefined function mime_content_type() in /home/*/*/Sources/Subs-InlineAttachments.php on line 1094

I've tested this with existing and new attachments. In both cases the image is displayed fine but the link to the attachment will redirect me to the error mentioned above.

I've tried this by first installing the suggested mod for inline attachments in PMs, I've tried it without the suggested mod. All links lead to the same error.

Any suggestions?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 01, 2018, 11:48:45 AM
Uploaded v6.5 - March 1st, 2018
o Fixed error relating to unavailable mime_content_type function.
o Added fallback code to use finfo_file when mime_content_type isn't available.




@Diadu:  Thanks for the bug report!  ::) The mod call a function that wasn't available, knowing it wasn't available....  Kinda stupid, if you ask me!   O:)  Anyways, it's been fixed for this version!
Title: Re: Post and PM Inline Attachments
Post by: Diadu on March 01, 2018, 12:20:23 PM
Quote from: dougiefresh on March 01, 2018, 11:48:45 AM
Uploaded v6.5 - March 1st, 2018
o Fixed error relating to unavailable mime_content_type function.
o Added fallback code to use finfo_file when mime_content_type isn't available.




@Diadu:  Thanks for the bug report!  ::) The mod call a function that wasn't available, knowing it wasn't available....  Kinda stupid, if you ask me!   O:)  Anyways, it's been fixed for this version!

Thanks! I tried out the new version and uploaded an attachment and clicking on the image or the link now initiates a download, excellent. It looks like it didn't fix any of the old attachments, but luckily the forum I made is pretty new so there weren't many attachments.

Something else I have noticed is that if you disable the download link for a file in the settings, any text added after the attachment will be turned into a link. I attached two images. The first one is with the download link enabled. The second image is with the download link disabled and the text turned into a link. I hope it makes sense lol

Edit: Also happens when I use the attachmini tag because that omits the download link
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 01, 2018, 12:38:36 PM
@Diadu: I'll look further into these reports!

@Everybody Else:  If you have reported the same issues as Diadu, I apologize for not looking into these reports earlier!
Title: Re: Post and PM Inline Attachments
Post by: lwiz on March 02, 2018, 07:56:50 AM
First of all big thank you for plug in replacement for the aging smf-ila!

On Postgres there was a slight problem with query from query in Sources/Subs-InlineAttachmentsAdmin.php:

Tietokantavirhe: ERROR: column "%[attach%" does not exist
LINE 4: WHERE body LIKE "%[attach%"
^

SELECT COUNT(*) AS count
FROM verstas_messages
WHERE body LIKE "%[attach%" Tiedosto: Sources/Subs-InlineAttachmentsAdmin.php
Rivi: 219


I fixed this changing the delimiters next to %[attach% into 's and changing the query delimiters to "s - MySQL is I believe agnostic with using 's or "s whereas Postgres is far more strict.

I ended up with following code in the query:

                // Get the number of post/PMs that have an ILA tag within it:^M
                $request = $smcFunc['db_query']('', "
                        SELECT COUNT(*) AS count
                        FROM {db_prefix}" . $table . "
                        WHERE body LIKE '%[attach%'",
                        array()
                );
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 02, 2018, 10:52:16 AM
@lwiz:  Thanks for reporting this!  Do me a favor and replace your code with this fragment:

// Get the number of post/PMs that have an ILA tag within it:
$request = $smcFunc['db_query']('', '
SELECT COUNT(*) AS count
FROM {db_prefix}' . $table . '
WHERE body LIKE {string:body}',
array(
'body' => '%[attach%',
)
);

Let me know if it works any better for you!
Title: Re: Post and PM Inline Attachments
Post by: lwiz on March 02, 2018, 11:14:06 AM
Works without a hitch, thank you!

BTW, I wrote finnish-utf8 userguide and probably will get the admin part done during the weekend. I'll happily donate those if they are of any use for you?

-L
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 02, 2018, 02:15:48 PM
Thanks!  It'll be part of the next version!  Sure, translations are always welcome!
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 04, 2018, 12:16:58 AM
Quote from: Diadu on March 01, 2018, 12:20:23 PM
Thanks! I tried out the new version and uploaded an attachment and clicking on the image or the link now initiates a download, excellent. It looks like it didn't fix any of the old attachments, but luckily the forum I made is pretty new so there weren't many attachments.

Something else I have noticed is that if you disable the download link for a file in the settings, any text added after the attachment will be turned into a link. I attached two images. The first one is with the download link enabled. The second image is with the download link disabled and the text turned into a link. I hope it makes sense lol

Edit: Also happens when I use the attachmini tag because that omits the download link
Both issues are fixed.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 04, 2018, 09:51:25 AM
Uploaded v6.6 - March 4th, 2018
o Made changes to admin tag adjustment code for better Postgres compatibility.
o Fixed an issue where text after inline attachment was a hyperlink.
Title: Re: Post and PM Inline Attachments
Post by: SaltedWeb on March 04, 2018, 03:00:28 PM
Will this work to put 2, photos side by side as opposed to vertical?
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 04, 2018, 10:14:11 PM
@SaltedWeb:  If you don't use the download counter crap, then yes, it should work so that you can place 2 photos side-by-side, width permitting....  You will probably have to use the float parameters if you use the download counters.
Title: Re: Post and PM Inline Attachments
Post by: SaltedWeb on March 05, 2018, 06:02:23 PM
Thank Dougie I found it was not comparable with one of my mods, i'll have to find another way to put them side by side.
I am really surprised by default there is not a vertical / horizontal option. As it forces one to use allot of space to make it look right.
Not speaking of your Mod I meant SMF I don't post pictures much but was going to do it and found it lines them all up in a row regardless of size. I think I finally found something on SMF I find annoying, looking back seems something asked allot and no real solutions I could find. Thanks
Title: Re: Post and PM Inline Attachments
Post by: jakes_t on March 09, 2018, 06:19:04 PM
Side by side pictures would just over complicate things, especially for large pictures. A large thumbnail clickable to full along with this mod: https://www.simplemachines.org/community/index.php?topic=521231.0 (Resize pictures). This works very nicely for resizing pictures directly from phones and it corrects the orientation as well (which is broken on SMF).
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 09, 2018, 10:22:33 PM

Quote from: SaltedWeb on March 05, 2018, 06:02:23 PM
I'll have to find another way to put them side by side.
For inline images displayed within posts setting values for "Restrict images to maximum width of:" and "Restrict images to maximum height of:" to something like 240/180 or 320/240 keeps the images quite small horizontally when displayed in posts (especially if "Download link and counter setting:" is set to "Disabled") but you can still encounter horizontal spacing issues when images have long file names.

For thumbnail images displayed below posts I've been using Custom View of Attachments* (https://dragomano.ru/mods/custom-view-of-attachments) since 2013 to display thumbnails side by side and it works perfectly on my SMF 2.0.15 forums.
Note: You must install the New Hooks (https://www.simplemachines.org/community/index.php?topic=418177.msg3499865#msg3499865) package first.

After installing Custom View of Attachments* (https://dragomano.ru/mods/custom-view-of-attachments) you'll need to edit ./Sources//Subs-CustomView.php and make the following change:
Find:
function custom_view_buffer(&$buffer)

Replace With:
function custom_view_buffer($buffer)


This is the list of packages I install (and this is the order I install them in) for image viewing in posts and PMs:
New Hooks
Custom View of Attachments
Highslide Image Viewer
PM Attachments
Post and PM Inline Attachments



* This mod used to be available here (https://www.simplemachines.org/community/index.php?topic=418177.msg2921188#msg2921188) but is now only available from the developers website.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 10, 2018, 02:34:16 AM
Quote from: GL700Wing on March 09, 2018, 10:22:33 PM
... but you can still encounter horizontal spacing issues when images have long filenames.
After posting my previous message I realised that long filenames are truncated when using the Custom View of Attachments (https://dragomano.ru/mods/custom-view-of-attachments) mod with the "In the line (horizontally)" option so I thought I'd have a go at implementing the same thing for this mod and also add the option for having just the filename and size/dimensions (ie, without the download count) displayed over two lines.

The following changes will display a link name to an image filename that is no wider than the displayed image size for an inline image and this will prevent long link names from taking up unnecessary horizontal space.  In addition, there is now an option to display the filename and size/dimensions over two lines.

Finally, and while it may seem logical to have the 'Filename, Size and Dimensions (2 Lines)' option displayed immediately after the 'Filename, Size and Dimensions' option in the drop-down list this would change the information that is displayed for people who have already selected one of the 'Filename, Size, Dimensions and Count' options.

In ./Themes/default/languages/InlineAttachmentsAdmin.english.php
Find:
$txt['ila_download_count_fsdc3'] = 'Filename, Size, Dimensions and Count (3 Lines)';
Add After:
$txt['ila_download_count_fsd2'] = 'Filename, Size and Dimensions (2 Lines)';


In ./Sources/Subs-InlineAttachmentsAdmin.php
Find:
$txt['ila_download_count_fsdc3']
Add After:
, $txt['ila_download_count_fsd2']


In ./Sources/Subs-InlineAttachments.php
Find:
// Let's build the HTML code for the download count now....
$html = (!empty($html) ? $html . '<br/>' : '') .
'<span class="smalltext">' .
'<a href="' . $attachment['href'] . '">' .
'<img src="' . $settings['images_url'] . '/icons/clip.' . (!isset($txt['attach_times']) ? 'png' : 'gif') . '" align="middle" alt="*" border="0" /> ' . $attachment['name'] .
'</a>' .

Replace with:
// Let's build the HTML code for the download count now....
$title = $attachment['name'];
$name = $title;
if ($attachment['is_image'])
{
if (!empty($modSettings['ila_max_width']))
$name = $dimensions['width'] < $modSettings['ila_max_width'] ? $smcFunc['substr']($attachment['name'], 0, round($dimensions['width']/7, 0)) : $smcFunc['substr']($attachment['name'], 0, round($modSettings['ila_max_width']/7, 0));
else
$name = $smcFunc['substr']($attachment['name'], 0, round($dimensions['width']/7, 0));
}

$html = (!empty($html) ? $html . '<br/>' : '') .
'<span class="smalltext">' .
'<img src="' . $settings['images_url'] . '/icons/clip.' . (!isset($txt['attach_times']) ? 'png' : 'gif') . '" align="middle" alt="*" border="0" /> ' .
'<a href="' . $attachment['href'] . '" title="' . $title . '">' . $name . '</a>' .


Find:
($download_count >= 4 ? (
Replace with:
($download_count >= 4 && $download_count <= 6 ? (
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 10, 2018, 04:50:15 AM
FYI - This fix is also outstanding: https://www.simplemachines.org/community/index.php?topic=525705.msg3962375#msg3962375
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 10, 2018, 12:55:22 PM
I've got these fixes added to the mod, with exception of the "truncation of long filename" fix.  I've come up with a different method of filename truncation via CSS.  However, I screwed up the language files and don't have time to fix them before I go to work.  So it'll probably be tomorrow sometime when the new mod gets released.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 10, 2018, 01:28:06 PM
Quote from: dougiefresh on March 10, 2018, 12:55:22 PM
I've got these fixes added to the mod, with exception of the "truncation of long filename" fix.  I've come up with a different method of filename truncation via CSS.  However, I screwed up the language files and don't have time to fix them before I go to work.  So it'll probably be tomorrow sometime when the new mod gets released.
Excellent - I did read about using CSS ellipsis for truncating long filenames but I didn't know how to go about implementing it for this mod although I did get it working for the Highslide mod I use.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 15, 2018, 11:21:10 AM
Uploaded v6.7 - March 15th, 2018
o Per GL700Wing (https://www.simplemachines.org/community/index.php?topic=525705.msg3962375#msg3962375): Add space on either side of each new inline attachment tag.
o Per GL700Wing (https://www.simplemachines.org/community/index.php?topic=525705.msg3964928#msg3964928): Fixed buffer issue in Sources/Subs-CustomView.php.
o Added CSS and code for a fix for truncating long filenames to picture width.
o Removed obsolete ILA.css file from the mod file list.
o Removed obsolete popup language strings.
o Added code to filter HTML tags from TXT files.
o Added admin option to disable filtering HTML from TXT files.




@Everybody:  Sorry it took so long.  Had to deal with too many damn computer problems....  Anyways, here the update is: a few days late, but better late than never....

@Rock Lee:  There are some language strings that need to be translated!  It would be appreciated if you could translate them.  They begin with //....
Title: Re: Post and PM Inline Attachments
Post by: -Rock Lee- on March 15, 2018, 12:40:38 PM
It is very nice to see how you are updating all your modifications really, that's why here I leave you updated also the translations with some improvements :)!


Regards!
Title: Re: Post and PM Inline Attachments
Post by: @rjen on March 15, 2018, 02:26:41 PM
Updated to the new version. I noticed that it has a dependency on the mod Automatic Attachment rotation (had to uninstall that one before updating this one)

I also noticed that in the newer version the paperclip icon and the attachment filename are on separate lines. Is that on purpose?

The previous version was more compact: paperclip icon on the same line as the attachment name. I liked that better...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 15, 2018, 05:45:51 PM
Uploaded v6.8 - March 15th, 2018
o Included updated Subs-InlineAttachments.php file.
o Updated Spanish Latin translation by Rock Lee (http://www.simplemachines.org/community/index.php?action=profile;u=322597).



@Rock Lee:  Thank you for the updated translations!  They've been included in this version!

Quote from: @rjen on March 15, 2018, 02:26:41 PM
Updated to the new version. I noticed that it has a dependency on the mod Automatic Attachment rotation (had to uninstall that one before updating this one)
It's not so much a dependency on the mod, but both mods altering the same area of code.....

Quote from: @rjen on March 15, 2018, 02:26:41 PM
I also noticed that in the newer version the paperclip icon and the attachment filename are on separate lines. Is that on purpose?
No, evidentally I forgot to copy the updated files to the mod folder before I zipped everything up for distribution....
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 16, 2018, 01:19:28 AM
I installed this mod and noticed that 'Size', 'Dimensions' and 'Count' are not always displayed when the truncated image name is the same width as the image the although they do display when the '2 lines' and '3 lines' options are selected.

The challenge is that the horizontal space required to display 'Size', 'Dimensions' and 'Count' can, in some instances, be the same as the image width (eg, when the image width or ILA max width is 240px or less) which means it may not actually be possible to display any of this additional information.

The following code change in ./Sources/Subs-InlineAttachments.php resolves this issue although it does mean that 'Size', 'Dimensions' and 'Count' will always be displayed on a second line even if neither of the '2 lines' options are chosen.  However, if one of the '2 lines'/'3 lines' options are chosen the additional lines will be displayed with tighter vertical spacing and better horizontal alignment.  It also fixes a couple of minor issues in relation to the information displayed for non-image attachments (eg, extra '-' scharacters).
Find:
// Let's build the HTML code for the download count now....
$title = $attachment['name'];
$name = $title;

$html = (!empty($html) ? $html . '<br/>' : '') .
'<div class="smalltext" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: ' . (!empty($modSettings['ila_max_width']) ? ($dimensions['width'] < $modSettings['ila_max_width'] ? $dimensions['width'] : $modSettings['ila_max_width']) : $dimensions['width']) . 'px;">' .
'<img src="' . $settings['images_url'] . '/icons/clip.' . (!isset($txt['attach_times']) ? 'png' : 'gif') . '" align="middle" alt="*" border="0" /> ' .
'<a href="' . $attachment['href'] . '" title="' . $title . '">' . $name . '</a>' .   ($download_count ? (
($download_count >= 5 ? '<br/>' : ' ') .
($download_count >= 2 ? '(' . $attachment['size'] : '') .
($download_count >= 3 && $attachment['is_image'] && !empty($dimensions['width']) ? ', ' . $dimensions['width'] . 'x' . $dimensions['height'] : '') .
($download_count >= 4 && $download_count <= 6 ? (
($download_count == 6 ? ')<br/>(' : ' - ') .
($attachment['is_image'] ? $viewed : ' - ' . $downloaded)
) : '') .
($download_count >= 2 ? ')' : '')
) : '') .
'</div>';


Replace With:
// Let's build the HTML code for the download count now....
$html = (!empty($html) ? $html . '<br/>' : '') .
'<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;">' .
'<img style="float:left; margin-top:0.5em;" src="' . $settings['images_url'] . '/icons/clip.' . (!isset($txt['attach_times']) ? 'png' : 'gif') . '" align="middle" alt="*" /> ' .
'<a style="display:block; margin-left:1.2em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis" href="' . $attachment['href'] . '" title="' . $attachment['name'] . '">' . $attachment['name'] . '</a>' .
($download_count ? (
($download_count >= 5 ? '</span><br/><span class="smalltext" style="display:block; padding-left:1.2em; margin-top:-2.0em;">' : ' ') .
($download_count >= 2 ? '(' . $attachment['size'] : '') .
($download_count >= 3 && $attachment['is_image'] && !empty($dimensions['width']) ? ', ' . $dimensions['width'] . 'x' . $dimensions['height'] : '') .
($download_count >= 4 && $download_count <= 6 ? (
($download_count == 6 ? ')</span><br/><span class="smalltext" style="display:block; padding-left:1.2em; margin-top:-2.0em;">(' : ' - ') .
($attachment['is_image'] ? $viewed : $downloaded)
) : '') .
($download_count >= 2 ? ')' : '')
) : '') .
'</span>';



BTW:  The reason I test for image width greater than zero (and assign a width if necessary) is because I recently discovered I have images with '0' dimensions in a database which was converted from vBulletin.  I don't know if the images actually exist and/or are referenced in any messages but I figured it's safer to assign a width rather than run the risk of generating error messages.  Also, assigning a width for non-image attachments (eg, text and PDF files) means their file names are also truncated which I think is a nice side-effect.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 18, 2018, 11:51:56 AM
*Bump*

I know you've been busy writing other mods ;) and you now also have a GitHub issue to deal with but I thought I'd bump this just in case you haven't already seen my previous post.
Title: Re: Post and PM Inline Attachments
Post by: pepa on March 19, 2018, 02:28:44 AM
Is this mod compatible with (and works with) the Mod - Resize Attached Images Ver. 2.4.1?
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 19, 2018, 04:29:41 AM
Quote from: pepa on March 19, 2018, 02:28:44 AM
Is this mod compatible with (and works with) the Mod - Resize Attached Images Ver. 2.4.1?
Yep - I have both mods installed and working together on two SMF 2.0.15 forums.
Title: Re: Post and PM Inline Attachments
Post by: pepa on March 19, 2018, 05:51:46 AM
Quote from: GL700Wing on March 19, 2018, 04:29:41 AM
Quote from: pepa on March 19, 2018, 02:28:44 AM
Is this mod compatible with (and works with) the Mod - Resize Attached Images Ver. 2.4.1?
Yep - I have both mods installed and working together on two SMF 2.0.15 forums.

Thanks for your reply GL700Wing : ).  I'll take it out for a test drive.
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on March 22, 2018, 08:54:25 PM
Uploaded v6.9 - March 20th, 2018
o Changed HTML download count building code, based on GL700's post (https://www.simplemachines.org/community/index.php?topic=525705.msg3965711#msg3965711).




@GL700Wing:  Very interesting!  The fix is included in this release!  Thanks again for your contribution!
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 25, 2018, 01:58:30 AM
Quote from: dougiefresh on March 22, 2018, 08:54:25 PM
@GL700Wing:  Very interesting!  The fix is included in this release!  Thanks again for your contribution!
You're welcome.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 29, 2018, 08:36:26 AM
A little tweak for this mod when used in conjunction with Custom View of Attachments (https://dragomano.ru/mods/custom-view-of-attachments) to display the information about attachments that are not inline in the same way it is displayed for attachments that are inline (ie, using ellipsis for long names, displaying size and dimensions for images, setting maximum horizontal width for non-image attachments, and displaying attachment information on second line) and displaying approve/delete links on third line:

In ./Sources/Subs-CustomView.php
Find:
if ($modSettings['custom_view_attachments'] != 2)
{
$title = $attachment['name'];
$name = $attachment['width'] < $modSettings['attachmentThumbWidth'] ? $smcFunc['substr']($attachment['name'], 0, round($attachment['width']/7, 0)) : $smcFunc['substr']($attachment['name'], 0, round($modSettings['attachmentThumbWidth']/7, 0));
echo '
<img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" />&nbsp;<a href="' . $attachment['href'] . '" title="' . $title . '">' . $name . '</a> ';
}
}
else
echo '

<img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" />&nbsp;<a href="' . $attachment['href'] . '">' . $attachment['name'] . '</a><br />';

if (!$attachment['is_approved'])
echo '
[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';


if (!$attachment['is_image'])
echo '(' . $attachment['size'] . ' ~ ' . (!$attachment['is_image'] ? $txt['custom_view_attachments_downloads'] : $txt['custom_view_attachments_views']) . $attachment['downloads'] . ')';


Replace With:
if ($modSettings['custom_view_attachments'] != 2)
echo '
<span style="display:block; ' . 'width:' . ($attachment['width'] > 0 ? (!empty($modSettings['attachmentThumbWidth']) && $modSettings['attachmentThumbWidth'] < $attachment['width'] ? $modSettings['attachmentThumbWidth'] : $attachment['width']) : 150) . 'px;">
<img class="ila_img" src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" />
<a class="ila_link" href="' . $attachment['href'] . '" title="' . $attachment['name'] . '">' . $attachment['name'] . '</a></span><br /><span>
<span class="ila_span" style="margin-top:-1.5em;">(', $attachment['size'] . ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ')</span>';
}
else
echo '
<span style="display:block; ' . 'max-width:' . (!empty($modSettings['attachmentThumbWidth']) ? $modSettings['attachmentThumbWidth'] : 150) . 'px;">
<img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" />&nbsp;
<a class="ila_link" style="margin-top:-2.0em;" href="' . $attachment['href'] . '" title="' . $attachment['name'] . '">' . $attachment['name'] . '</a></span><br />' .
($modSettings['custom_view_attachments'] != 2 ? '<span class="ila_span" style="margin-top:-1.5em;">(' . $attachment['size'] . ' ~ ' . $txt['custom_view_attachments_downloads'] . $attachment['downloads'] . ')</span>' : '');

if (!$attachment['is_approved'])
echo '
[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';




Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on April 03, 2018, 06:06:02 PM
Uploaded v6.10 - April 3rd, 2018
o Per GL700Wing's post (https://www.simplemachines.org/community/index.php?topic=525705.msg3967320#msg3967320), modified Custom Views of Attachments (https://dragomano.ru/mods/custom-view-of-attachments) mod to match attachment viewing modifications.




@GL700Wing:  Busy little beaver you are!  Thanks again for the code contributions!  They've been included in this version!
Title: Re: Post and PM Inline Attachments
Post by: pepa on April 25, 2018, 04:47:48 AM
Hi Dougie

I'm running version 6.8 on SMF 2.0.15 Responsive Curve 1.0.0

Do I need to uninstall before installing the latest update for the Mod?

Also a problem ... I checked the option "Should first attachment should be numbered "1"?", clicked OK, but when I clicked save at the bottom I received the error message in the attached file.  I haven't installed the PM Attachments Mod as I didn't want that functionality ... is that the source of this error and do I need to be concerned?

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 25, 2018, 05:06:50 AM
Quote from: pepa on April 25, 2018, 04:47:48 AM
I'm running version 6.8 on SMF 2.0.15 Responsive Curve 1.0.0

Do I need to uninstall before installing the latest update for the Mod?
Yes.

QuoteAlso a problem ... I checked the option "Should first attachment should be numbered "1"?", clicked OK, but when I clicked save at the bottom I received the error message in the attached file.
I've been helping Doug with some of his mods and I've just fixed this problem today - just waiting for him to let me know if I can update the mod on his behalf.

QuoteI haven't installed the PM Attachments Mod as I didn't want that functionality ... is that the source of this error and do I need to be concerned?
The error is caused by a bug in this mod and it prevents the renumbering of image attachments in existing messages - in V6.11 you will need to disable/save then re-enable/save the the Should first attachment should be numbered "1"? option for renumbering of image attachments in existing messages to occur.
Title: Re: Post and PM Inline Attachments
Post by: pepa on April 25, 2018, 06:12:02 AM
Thanks GL700Wing : )  Guess I'll wait for the next updated mod with the error fixed before I uninstall and then install the latest version.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 26, 2018, 07:18:15 PM
Uploaded v6.11 - April 27th, 2018
o As per pepa's (https://www.simplemachines.org/community/index.php?topic=525705.msg3970133#msg3970133) post fixed issue that was causing change of Should first attachment should be numbered "1"? option to throw error for SQL query.
o For SMF 2.0: Re-added code to display a label if an attachment in a post which is being edited is awaiting approval.
Title: Re: Post and PM Inline Attachments
Post by: @rjen on April 27, 2018, 11:13:01 AM
Problem with the new version: EVERY attachment is now numbered as attachment 0...

Title: Re: Post and PM Inline Attachments
Post by: @rjen on April 27, 2018, 11:35:36 AM
Find the dutch language files attached...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 28, 2018, 12:10:35 AM
v6.12 - April 28th, 2018
o Per @rjen (https://www.simplemachines.org/community/index.php?topic=525705.msg3970389#msg3970389) - added Dutch language files.
o Added UTF8 language files for English.




Thanks @rjen (https://www.simplemachines.org/community/index.php?action=profile;u=287786) for the Dutch language files.

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 28, 2018, 12:11:36 AM
Quote from: @rjen on April 27, 2018, 11:13:01 AM
Problem with the new version: EVERY attachment is now numbered as attachment 0...
This issue was caused by a bug in v5.0 of the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod and has been fixed in v5.1.
Title: Re: Post and PM Inline Attachments
Post by: BellGab.com on April 29, 2018, 05:45:45 AM
Thanks for continuing to develop this.
Title: Re: Post and PM Inline Attachments
Post by: Beowulf1976 on June 02, 2018, 03:59:45 PM
OK, so first off, I am pretty sure *I* have made this error by not reading the readme.txt before installing and running "Automatic Attachment Rotation (and Resize)"


I already had Post and PM Inline Attachments mod installed.... all my inline attachments were working just fine...


but when I installed your attachment resize mod, I now have some very borked attachments. (apologies in advance for the next four lines of text!)


Some people report that the images are resized nicely and they can see them whilst logged in, and not logged in.
Some people report that whether they are logged in or not, they see "invalid attachment" (yet when I modify the post they talk about, your image attachment coding is still there and looks fine)
Some people report that they can only see the images when logged in, and cannot when logged out.
Some people report that they can only see the images when NOT logged in, and "invalid attachment" is there when logged in.


I have asked all testers to erase their cache to ensure that either problem is not being caused by cache.

When looking in the error logs, I have over 100k errors that state there is an issue with:
8: Undefined index: thumb_hash
File: *******************/forum/Sources/Display.php
Line: 1825

First the entire section of coding so you know what you're looking at:

// End Automatic Attachment Rotation (and Resize) mod.


$attachmentData[$i]['real_width'] = $attachment['width'];
$attachmentData[$i]['width'] = $attachment['width'];
$attachmentData[$i]['real_height'] = $attachment['height'];
$attachmentData[$i]['height'] = $attachment['height'];


// Let's see, do we want thumbs?
if (!empty($modSettings['attachmentThumbnails']) && !empty($modSettings['attachmentThumbWidth']) && !empty($modSettings['attachmentThumbHeight']) && ($attachment['width'] > $modSettings['attachmentThumbWidth'] || $attachment['height'] > $modSettings['attachmentThumbHeight']) && strlen($attachment['filename']) < 249)
{
// A proper thumb doesn't exist yet? Create one!
if (empty($attachment['id_thumb']) || $attachment['thumb_width'] > $modSettings['attachmentThumbWidth'] || $attachment['thumb_height'] > $modSettings['attachmentThumbHeight'] || ($attachment['thumb_width'] < $modSettings['attachmentThumbWidth'] && $attachment['thumb_height'] < $modSettings['attachmentThumbHeight']))
{
$filename = getAttachmentFilename($attachment['filename'], $attachment['id_attach'], $attachment['id_folder']);


require_once($sourcedir . '/Subs-Graphics.php');
if (createThumbnail($filename, $modSettings['attachmentThumbWidth'], $modSettings['attachmentThumbHeight']))
{
// So what folder are we putting this image in?
if (!empty($modSettings['currentAttachmentUploadDir']))
{
if (!is_array($modSettings['attachmentUploadDir']))
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);
$path = $modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']];
$id_folder_thumb = $modSettings['currentAttachmentUploadDir'];
}
else
{
$path = $modSettings['attachmentUploadDir'];
$id_folder_thumb = 1;
}


// Calculate the size of the created thumbnail.
$size = @getimagesize($filename . '_thumb');
list ($attachment['thumb_width'], $attachment['thumb_height']) = $size;
$thumb_size = filesize($filename . '_thumb');


// These are the only valid image types for SMF.
$validImageTypes = array(1 => 'gif', 2 => 'jpeg', 3 => 'png', 5 => 'psd', 6 => 'bmp', 7 => 'tiff', 8 => 'tiff', 9 => 'jpeg', 14 => 'iff');


// What about the extension?
$thumb_ext = isset($validImageTypes[$size[2]]) ? $validImageTypes[$size[2]] : '';


// Figure out the mime type.
if (!empty($size['mime']))
$thumb_mime = $size['mime'];
else
$thumb_mime = 'image/' . $thumb_ext;


$thumb_filename = $attachment['filename'] . '_thumb';
$thumb_hash = getAttachmentFilename($thumb_filename, false, null, true);


// Add this beauty to the database.
$smcFunc['db_insert']('',
'{db_prefix}attachments',
array('id_folder' => 'int', 'id_msg' => 'int', 'attachment_type' => 'int', 'filename' => 'string', 'file_hash' => 'string', 'size' => 'int', 'width' => 'int', 'height' => 'int', 'fileext' => 'string', 'mime_type' => 'string'),
array($id_folder_thumb, $id_msg, 3, $thumb_filename, $thumb_hash, (int) $thumb_size, (int) $attachment['thumb_width'], (int) $attachment['thumb_height'], $thumb_ext, $thumb_mime),
array('id_attach')
);
$old_id_thumb = $attachment['id_thumb'];
$attachment['id_thumb'] = $smcFunc['db_insert_id']('{db_prefix}attachments', 'id_attach');
if (!empty($attachment['id_thumb']))
{
$smcFunc['db_query']('', '
UPDATE {db_prefix}attachments
SET id_thumb = {int:id_thumb}
WHERE id_attach = {int:id_attach}',
array(
'id_thumb' => $attachment['id_thumb'],
'id_attach' => $attachment['id_attach'],
)
);


$thumb_realname = getAttachmentFilename($thumb_filename, $attachment['id_thumb'], $id_folder_thumb, false, $thumb_hash);
rename($filename . '_thumb', $thumb_realname);


// Do we need to remove an old thumbnail?
if (!empty($old_id_thumb))
{
require_once($sourcedir . '/ManageAttachments.php');
removeAttachments(array('id_attach' => $old_id_thumb), '', false, false);
}
}
}
}
else
$thumb_realname = getAttachmentFilename($attachment['thumb_name'], $attachment['id_thumb'], $attachment['thumb_folder'], false, $attachment['thumb_hash']);


// Get timestamp for thumbnail image:
$time = !empty($thumb_realname) && file_exists($thumb_realname) ? filemtime($thumb_realname) : false;


// Only adjust dimensions on successful thumbnail creation.
if (!empty($attachment['thumb_width']) && !empty($attachment['thumb_height']))
{
$attachmentData[$i]['width'] = $attachment['thumb_width'];
$attachmentData[$i]['height'] = $attachment['thumb_height'];
}
}


if (!empty($attachment['id_thumb']))
$attachmentData[$i]['thumbnail'] = array(
'id' => $attachment['id_thumb'],
'href' => $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attachment['id_thumb'] . ';image' . ';ts=' . $time,
);
$attachmentData[$i]['thumbnail']['has_thumb'] = !empty($attachment['id_thumb']);


// If thumbnails are disabled, check the maximum size of the image.
if (!$attachmentData[$i]['thumbnail']['has_thumb'] && ((!empty($modSettings['max_image_width']) && $attachment['width'] > $modSettings['max_image_width']) || (!empty($modSettings['max_image_height']) && $attachment['height'] > $modSettings['max_image_height'])))
{
if (!empty($modSettings['max_image_width']) && (empty($modSettings['max_image_height']) || $attachment['height'] * $modSettings['max_image_width'] / $attachment['width'] <= $modSettings['max_image_height']))
{
$attachmentData[$i]['width'] = $modSettings['max_image_width'];
$attachmentData[$i]['height'] = floor($attachment['height'] * $modSettings['max_image_width'] / $attachment['width']);
}
elseif (!empty($modSettings['max_image_width']))
{
$attachmentData[$i]['width'] = floor($attachment['width'] * $modSettings['max_image_height'] / $attachment['height']);
$attachmentData[$i]['height'] = $modSettings['max_image_height'];
}
}
elseif ($attachmentData[$i]['thumbnail']['has_thumb'])
{
// If the image is too large to show inline, make it a popup.
if (((!empty($modSettings['max_image_width']) && $attachmentData[$i]['real_width'] > $modSettings['max_image_width']) || (!empty($modSettings['max_image_height']) && $attachmentData[$i]['real_height'] > $modSettings['max_image_height'])))
$attachmentData[$i]['thumbnail']['javascript'] = 'return reqWin(\'' . $attachmentData[$i]['href'] . ';image\', ' . ($attachment['width'] + 20) . ', ' . ($attachment['height'] + 20) . ', true);';
else
$attachmentData[$i]['thumbnail']['javascript'] = 'return expandThumb(' . $attachment['id_attach'] . ');';
}


if (!$attachmentData[$i]['thumbnail']['has_thumb'])
$attachmentData[$i]['downloads']++;
}
}


// Do we need to instigate a sort?
if ($have_unapproved)
usort($attachmentData, 'approved_attach_sort');


return $attachmentData;
}


// A sort function for putting unapproved attachments first.
function approved_attach_sort($a, $b)
{
if ($a['is_approved'] == $b['is_approved'])
return 0;


return $a['is_approved'] > $b['is_approved'] ? -1 : 1;
}



Then, the actual line where the error is supposedly:


1825: $thumb_realname = getAttachmentFilename($attachment['thumb_name'], $attachment['id_thumb'], $attachment['thumb_folder'], false, $attachment['thumb_hash']);


I haven't remotely tried to fix anything because I'm thick af when it comes to all this...


and like I said, this COULD be an issue I have caused myself by NOT doing what your readme.txt file says prior to resizing current attachments.


Is there a way I can fix this, without going into each individual post and re-attributing the attachment to its coding (ie re-inserting them again)

(as far as I can tell, all the images are still attached at the bottom of the posts, they're just not positioned inline)


I'm not lazy, I have 2,222 posts to go through and 595 attachments to find :P :D


I hope you can help me, and not tell me off too much.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 06, 2018, 03:02:50 AM
Did you uninstall the Post and PM Inline Attachments mod before installing the latest version of this mod (ie, the version that includes the resize feature)?
Title: Re: Post and PM Inline Attachments
Post by: Beowulf1976 on June 07, 2018, 06:14:18 AM
They are completely different mods. They do different things.


I have the mods pictured below.

Neither of them say that they replace the other.


However, the readme.txt file in the autoattach gives instructions for the post and pm inline attachments mod before "activating" the auto attachment resize mod. I am afraid I did my usual and didn't read the readme, because I never expected to find that one borked the other if I didn't do as it says in the readme.


If you read my post thoroughly it explains all this. :) (I think it does, I have aphasia - so even though I've been using the English language for 40+ years, I now struggle sometimes as if it is a foreign language. So if I haven't explained it clearly, I am sorry.)




I have a desperate fight between getting people to use the forum and them being lazy Facebook goers and using Facebook to view images instead. IF I cannot get this fixed I will lose that fight and the $30 a month I pay for hosting and website builder will all be for nought. *sob*


A NEW image that someone posted today has "invalid Attachment" in its place for some people. I KNOW I probably caused this myself but I was hoping for help with a way to fix it?
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 07, 2018, 10:49:43 PM
QuoteThey are completely different mods. They do different things.
They are the same mod - the latest version includes the automatic resizing feature.

You should uninstall both versions in the reverse/opposite order to which you installed them and then reinstall only the latest version.
Title: Re: Post and PM Inline Attachments
Post by: Beowulf1976 on June 08, 2018, 11:40:02 AM
Quote from: GL700Wing on June 07, 2018, 10:49:43 PM
QuoteThey are completely different mods. They do different things.
They are the same mod - the latest version includes the automatic resizing feature.

You should uninstall both versions in the reverse/opposite order to which you installed them and then reinstall only the latest version.

They are not the same mod, considering I have lost my inline attachments option!


Now I cannot reinstall the inline attachments mod because of a multitude of test failed. Cheers, it seems to have broken my forum. My authors are not going to be pleased that their images are no longer inline and I cannot fix it.
Title: Re: Post and PM Inline Attachments
Post by: Beowulf1976 on June 08, 2018, 12:05:11 PM
I am restoring the database and uploading my backup to resort back to both mods still being installed and running. When I said that they were not the same, I meant they are not the same. If they were the same, then the inline attachments option would be available in the "newer mod", but it's not. Therefore they are not the same mod.
Title: Re: Post and PM Inline Attachments
Post by: Beowulf1976 on June 08, 2018, 05:02:14 PM
arggghh no, now all the images are corrupt. Like proper stripey messes. :'(
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 09, 2018, 06:22:13 AM
@Beowulf1976 - please accept my apologies for the confusion caused by my previous replies.  I misread your posts and misunderstood the issues you are experiencing which resulted in me providing incorrect information.

This mod (ie, "Post and PM Inline Attachments") does not modify any image attachment information in the database - it simply allows users to insert attachments in either forum posts or PMs (if the PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974) mod is already installed).

However, the  Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod can modify information in the database for existing images if the "Resize existing images" option is enabled.  That said, the problems you are describing are unusual because a variety of your users are experiencing different issues under different circumstances.

I'd be happy to help you identify the cause of the issues and also let you know what needs to be done to resolve them.  If you'd like my help please send me a PM to let me know.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 09, 2018, 06:32:21 AM
v6.13 - June 9th, 2018
o Added message for PM preview to indicate attachment has not been uploaded yet.
o Updated installation code for SMF 2.0.x to enable this mod to be installed and/or uninstalled before and/or after the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod without generating errors in Display.php.


Title: Re: Post and PM Inline Attachments
Post by: njtweb on June 12, 2018, 01:50:09 PM
Is there a setting so that when an image is clicked on it cannot be downloaded? I have the download line and counter setting set to disabled but if an image is clicked on it still downloads.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 12, 2018, 07:30:06 PM
Quote from: njtweb on June 12, 2018, 01:50:09 PM
Is there a setting so that when an image is clicked on it cannot be downloaded? I have the download line and counter setting set to disabled but if an image is clicked on it still downloads.
Not in this mod - it simply allows images to be displayed within the text of a message/PM.
Title: Re: Post and PM Inline Attachments
Post by: njtweb on June 13, 2018, 09:23:51 AM
Well that's odd, seems like it's something that was missed. I guess I can't use it then.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 13, 2018, 02:47:06 PM
Quote from: njtweb on June 13, 2018, 09:23:51 AM
Well that's odd, seems like it's something that was missed. I guess I can't use it then.
I'm not sure why you think it - it's function matches it's description.
Title: Re: Post and PM Inline Attachments
Post by: pepa on June 19, 2018, 05:56:12 AM
Getting this error a lot, does anyone know what it means?

Guest
IP address 120.154.2.185   
June 14, 2018, 05:52:22 AM
58dcdbc75b862015e29f15060a85985c
Type of error: Undefined
https://reformaps.org/forum/index.php?action=search2
8: Undefined index: href
File: /home2/reformaps/public_html/forum/Themes/default/languages/InlineAttachments.english.php (body_above sub template - eval?)
Line: 440
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on June 19, 2018, 06:08:26 AM
I still can't make it work... this has been happening for the several last version now - when I click 'insert' nothing whatsoever happens :(

Anybody has an idea as to what to check?

Thanks!
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 19, 2018, 06:37:04 AM
Quote from: pepa on June 19, 2018, 05:56:12 AM
Getting this error a lot, does anyone know what it means?

Guest
IP address 120.154.2.185   
June 14, 2018, 05:52:22 AM
58dcdbc75b862015e29f15060a85985c
Type of error: Undefined
https://reformaps.org/forum/index.php?action=search2
8: Undefined index: href
File: /home2/reformaps/public_html/forum/Themes/default/languages/InlineAttachments.english.php (body_above sub template - eval?)
Line: 440
Try enabling the "Disable evaluation of templates" setting in Server Settings to see if you can get a more meaningful error message - the file ./Themes/default/languages/InlineAttachments.english.php only has 26 lines and the error is being generated elsewhere.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 19, 2018, 06:39:25 AM
Quote from: Gryzor on June 19, 2018, 06:08:26 AM
I still can't make it work... this has been happening for the several last version now - when I click 'insert' nothing whatsoever happens :(

Anybody has an idea as to what to check?
Not really - it could be a Javascript conflict with another mod.

Are you able to get it working on a test forum that doesn't have any other mods installed?
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on June 19, 2018, 06:44:19 AM
Hm, no. A conflict is what I thought, too, but the problem appeared out of the blue - not some mod I installed. I think I had just updated this one.

I'm pretty sure it'd work fine on a test forum with no other mods, so it's potentially a useless exercise though?

I'll see if I can further reduce the amount of mods I'm using; I was wondering though if there was some concrete method to find where the error is generated...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 19, 2018, 06:50:35 AM
Quote from: Gryzor on June 19, 2018, 06:44:19 AM
Hm, no. A conflict is what I thought, too, but the problem appeared out of the blue - not some mod I installed. I think I had just updated this one.

I'm pretty sure it'd work fine on a test forum with no other mods, so it's potentially a useless exercise though?
If you think it's not caused by a mod conflict then installing it on a forum on the same host that no other mods installed will confirm it's not a hosting-related issue.

QuoteI'll see if I can further reduce the amount of mods I'm using; I was wondering though if there was some concrete method to find where the error is generated...
Are you actually getting any error messages?
Title: Re: Post and PM Inline Attachments
Post by: Gryzor on June 19, 2018, 06:52:07 AM
Forgot to mention that - apologies. No, there are no error messages...
Title: Re: Post and PM Inline Attachments
Post by: demlak on June 20, 2018, 07:30:58 PM
any idea how to convert old postings in smf_messages table to match this mod with old postings made with this old mod?
https://www.simplemachines.org/community/index.php?topic=376767.0

just replacing
                                                                      [attachimg=
with
                                                                      [attachment=
would not do the trick for example on
                                                                      [attachment=1 width=750 align=center]


also matching with regex like:
                                                                      perl -pE 's/\[attachimg=(\d+).*?\]/[attachment=$1]/'
does not reflect alignment.
Title: Re: Post and PM Inline Attachments
Post by: mossite on August 06, 2018, 05:20:11 AM
I need someone to install this mode and pm attachment for me paid work


pm attachment<br>
https://custom.simplemachines.org/mods/index.php?mod=1974<br>
<br>
post and pm online attachment<br>
http://custom.simplemachines.org/mods/index.php?mod=3770
Title: Re: Post and PM Inline Attachments
Post by: GigaWatt on August 06, 2018, 10:26:16 AM
Technical support (free or paid) is requested in the following board.

https://www.simplemachines.org/community/index.php?board=50.0
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 16, 2018, 10:44:24 PM
Quote from: GigaWatt on August 06, 2018, 10:26:16 AM
Technical support (free or paid) is requested in the following board.

https://www.simplemachines.org/community/index.php?board=50.0
Much wow, much specific....  :P You're going to have to be more specific in specifying which topic you're pointing to.  As of right now, this is a USELESS post and is going to be completely ignored.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on August 16, 2018, 11:11:51 PM
I think @GigaWatt's comment was aimed at the previous post ...
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on August 17, 2018, 10:12:43 AM
Quite right....  I completely missed the post previous to it....  Apologies!
Title: Re: Post and PM Inline Attachments
Post by: GigaWatt on August 19, 2018, 07:14:00 PM
Maybe I should have quoted :S.

Never mind ;). All is good ;).
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 18, 2018, 08:42:29 AM
v6.14 - September 18th, 2018
o Fixed issue that prevented attachments being inserted inline (and which actually de-selected attachments) when a previously saved post that already had the maximum number of attachments allowed was being modified to insert the attachments inline.
o Commented out check in ./Sources/Subs-InlineAttachmentsAdmin.php for later version of ILA as domain www.xptsp.com has expired and version check was causing 'Inline Attachments' menu option to hang/timeout.
o Temporarily removed support for SMF 2.1 Beta 3 (this will be reinstated when time permits).
Title: Re: Post and PM Inline Attachments
Post by: dougiefresh on October 25, 2018, 11:47:43 AM
Uploaded v6.15 - October 25th, 2018
o No functionality change.
o Updated documentation to point to new website.
Title: Re: Post and PM Inline Attachments
Post by: NStorm on December 21, 2018, 05:35:18 AM
Any news/ideas on how to fix attachments in WYSIWYG mode?
Title: Re: Post and PM Inline Attachments
Post by: kkog on January 16, 2019, 10:33:26 PM
Hi Dougiefresh,

We have been using this mod for some time with success.

The latest version 6.15 threw quite a number of errors when I tried to install it so we are using version 6.14

With this version, the attachment remains at the bottom of the post with the option "Remove attachment image under post after in-post use" checked.  This option worked in previous versions of the mod

Regards
KKOG Forum Admin
Title: Re: Post and PM Inline Attachments
Post by: Motorhed on March 02, 2019, 06:25:18 PM
I have edited my SSI.php file so that board news type posting shows the attachment in a thread. Unfortunately, installing this mod breaks the images displayed by SSI.

Any idea how I can change that?
Title: Re: Post and PM Inline Attachments
Post by: aksal on April 08, 2019, 03:39:21 PM
I hope someone will help me with my issue. I have the Remove attachment image under post after in-post use? option checked, but the attachments are still showing under the post, as they do normally without this mod installed. Otherwise, the mod works perfectly for me.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 08, 2019, 06:38:30 PM
Quote from: kkog on January 16, 2019, 10:33:26 PMWith this version, the attachment remains at the bottom of the post with the option "Remove attachment image under post after in-post use" checked.  This option worked in previous versions of the mod.

Quote from: aksal on April 08, 2019, 03:39:21 PMI hope someone will help me with my issue. I have the Remove attachment image under post after in-post use? option checked, but the attachments are still showing under the post, as they do normally without this mod installed. Otherwise, the mod works perfectly for me.

I have been helping Doug with the maintenance of this mod and unfortunately I have not been able to reproduce this issue on an SMF 2.0.15 forum that has no other mods installed or on three separate SMF 2.0.15 forums I manage that each have between 110 and 140 other mods installed.

Are you able to provide any more information about your forum (eg, SMF version, theme being used, other mods installed, etc)?
Title: Re: Post and PM Inline Attachments
Post by: wintstar on July 31, 2019, 05:03:49 AM
Issues #5 (https://github.com/xptsp/Post_and_PM_Inline_Attachments/issues/5)

SMF 2.0.15
PHP: 5.5.35
Mod Version: v6.15.zip

Undefined offset: 12385
/Themes/default/Display.template.php
Zeile: 579

if (!empty($message['attachment']) && count($context['ila']['dont_show'][$msg_id]) != count($message['attachment']))
Title: Re: Post and PM Inline Attachments
Post by: wintstar on August 14, 2019, 06:09:44 AM
Quote from: wintstar on July 31, 2019, 05:03:49 AM
Issues #5 (https://github.com/xptsp/Post_and_PM_Inline_Attachments/issues/5)

SMF 2.0.15
PHP: 5.5.35
Mod Version: v6.15.zip

Undefined offset: 12385
/Themes/default/Display.template.php
Zeile: 579

if (!empty($message['attachment']) && count($context['ila']['dont_show'][$msg_id]) != count($message['attachment']))

Is there no solution?
Title: Re: Post and PM Inline Attachments
Post by: wintstar on August 22, 2019, 01:03:04 AM
Quote from: wintstar on August 14, 2019, 06:09:44 AM
Quote from: wintstar on July 31, 2019, 05:03:49 AM
Issues #5 (https://github.com/xptsp/Post_and_PM_Inline_Attachments/issues/5)

SMF 2.0.15
PHP: 5.5.35
Mod Version: v6.15.zip

Undefined offset: 12385
/Themes/default/Display.template.php
Zeile: 579

if (!empty($message['attachment']) && count($context['ila']['dont_show'][$msg_id]) != count($message['attachment']))

Is there no solution?

Has the support for the modification been discontinued? Will the mod no longer be developed?
Title: Re: Post and PM Inline Attachments
Post by: wintstar on September 07, 2019, 06:21:58 AM
Quote from: wintstar on August 22, 2019, 01:03:04 AM
Quote from: wintstar on August 14, 2019, 06:09:44 AM
Quote from: wintstar on July 31, 2019, 05:03:49 AM
Issues #5 (https://github.com/xptsp/Post_and_PM_Inline_Attachments/issues/5)

SMF 2.0.15
PHP: 5.5.35
Mod Version: v6.15.zip

Undefined offset: 12385
/Themes/default/Display.template.php
Zeile: 579

if (!empty($message['attachment']) && count($context['ila']['dont_show'][$msg_id]) != count($message['attachment']))

Is there no solution?

Has the support for the modification been discontinued? Will the mod no longer be developed?

@dougiefresh Is there no solution?
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 08, 2019, 08:43:16 PM
Quote from: wintstar on July 31, 2019, 05:03:49 AM
Issues #5 (https://github.com/xptsp/Post_and_PM_Inline_Attachments/issues/5)

SMF 2.0.15
PHP: 5.5.35
Mod Version: v6.15.zip

Undefined offset: 12385
/Themes/default/Display.template.php
Zeile: 579

if (!empty($message['attachment']) && count($context['ila']['dont_show'][$msg_id]) != count($message['attachment']))
@winstar I cannot reproduce the error you've reported with this mod using all default settings, with the following specs and with no other mods installed:
SMF 2.0.15
PHP: 5.5.38 (this is the lowest version of PHP 5.5 I have access to)
Mod Version: v6.15.zip

What mod settings are you using and/or do you have any other mods installed?
Title: Re: Post and PM Inline Attachments
Post by: Xpresskonami on October 15, 2019, 10:07:19 PM
i Enable responsive CSS for inline attachments?

But on my mobile view, the attachment is not RESPONSIVE as i Enable responsive CSS for inline attachments?

On Desktop view The attachment is RESPONSIVE as i Enable responsive CSS for inline attachments?

How can i fix the mobile which is not responsive when i Enable responsive CSS for inline attachments?
Title: Re: Post and PM Inline Attachments
Post by: Xpresskonami on October 16, 2019, 07:18:20 AM
Quote from: Xpresskonami on October 15, 2019, 10:07:19 PM
i Enable responsive CSS for inline attachments?

But on my mobile view, the attachment is not RESPONSIVE as i Enable responsive CSS for inline attachments?

On Desktop view The attachment is RESPONSIVE as i Enable responsive CSS for inline attachments?

How can i fix the mobile which is not responsive when i Enable responsive CSS for inline attachments?

Anyone here???
Title: Re: Post and PM Inline Attachments
Post by: Xpresskonami on October 16, 2019, 12:42:36 PM
Quote from: Xpresskonami on October 15, 2019, 10:07:19 PM
i Enable responsive CSS for inline attachments?

But on my mobile view, the attachment is not RESPONSIVE as i Enable responsive CSS for inline attachments?

On Desktop view The attachment is RESPONSIVE as i Enable responsive CSS for inline attachments?

How can i fix the mobile which is not responsive when i Enable responsive CSS for inline attachments?

solutions....???
Title: Re: Post and PM Inline Attachments
Post by: Bigguy on October 16, 2019, 12:54:48 PM
You will be waiting a long while if you continue to bump your posts before 24 hours. You have to give people time as this is all volunter. Maybe the mod author is busy at the present moment. Someone will be with you shortly I would think.
Title: Re: Post and PM Inline Attachments
Post by: Diego Andrés on October 16, 2019, 03:02:10 PM
Quote from: Xpresskonami on October 15, 2019, 10:07:19 PM
i Enable responsive CSS for inline attachments?

But on my mobile view, the attachment is not RESPONSIVE as i Enable responsive CSS for inline attachments?

On Desktop view The attachment is RESPONSIVE as i Enable responsive CSS for inline attachments?

How can i fix the mobile which is not responsive when i Enable responsive CSS for inline attachments?

1- Is this "responsive css for inline attachments" an options within the mod?
2- Have you installed the responsive curve mod or are you using a responsive theme?
Title: Re: Post and PM Inline Attachments
Post by: Xpresskonami on October 17, 2019, 07:46:23 PM
Quote from: Diego Andrés on October 16, 2019, 03:02:10 PM
Quote from: Xpresskonami on October 15, 2019, 10:07:19 PM
i Enable responsive CSS for inline attachments?

But on my mobile view, the attachment is not RESPONSIVE as i Enable responsive CSS for inline attachments?

On Desktop view The attachment is RESPONSIVE as i Enable responsive CSS for inline attachments?

How can i fix the mobile which is not responsive when i Enable responsive CSS for inline attachments?

1- Is this "responsive css for inline attachments" an options within the mod?
2- Have you installed the responsive curve mod or are you using a responsive theme?

Am using a responsive theme
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on December 03, 2019, 06:38:41 AM
Uploaded v6.16 - December 3, 2019
o Changed installation to avoid potential iOS issue that has affected Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod.
Title: Re: Post and PM Inline Attachments
Post by: Ninja ZX-10RR on December 30, 2019, 01:11:12 PM
Not sure whether Dougie will come back to this, his own site was shut down (after a rather bad issue a while ago) and he hasn't posted in a while... I kinda wanted to ask something but instead I'm gonna go with a good luck buddy, hope you figure things out and everything will work for you :)
Title: Re: Post and PM Inline Attachments
Post by: KittyGalore on December 30, 2019, 01:20:10 PM
Quote from: Ninja ZX-10RR on December 30, 2019, 01:11:12 PM
Not sure whether Dougie will come back to this, his own site was shut down (after a rather bad issue a while ago) and he hasn't posted in a while... I kinda wanted to ask something but instead I'm gonna go with a good luck buddy, hope you figure things out and everything will work for you :)
What happened to him.
Title: Re: Post and PM Inline Attachments
Post by: Ninja ZX-10RR on January 06, 2020, 07:45:28 PM
Quote from: KittyGalore on December 30, 2019, 01:20:10 PM
Quote from: Ninja ZX-10RR on December 30, 2019, 01:11:12 PM
Not sure whether Dougie will come back to this, his own site was shut down (after a rather bad issue a while ago) and he hasn't posted in a while... I kinda wanted to ask something but instead I'm gonna go with a good luck buddy, hope you figure things out and everything will work for you :)
What happened to him.
Don't have a clue.
Title: Re: Post and PM Inline Attachments
Post by: 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.
Title: Re: Post and PM Inline Attachments
Post by: 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!
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 09, 2020, 01:26:59 AM
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.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 09, 2020, 01:44:03 AM
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.
Title: Re: Post and PM Inline Attachments
Post by: Dave J 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.
Title: Re: Post and PM Inline Attachments
Post by: iLeoxmon on June 18, 2020, 02:43:08 PM
Is this module enable for others sites like regular websites?
Title: Re: Post and PM Inline Attachments
Post by: gohanjaja on June 18, 2020, 05:41:35 PM
plz, update for 2.1 rc2
Title: Re: Post and PM Inline Attachments
Post by: Deaks on June 18, 2020, 05:45:24 PM
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
Title: Re: Post and PM Inline Attachments
Post by: Deaks on June 18, 2020, 05:46:51 PM
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
Title: Re: Post and PM Inline Attachments
Post by: Arantor on June 18, 2020, 05:56:54 PM
I assume he's been busy with that 'real life' thing and his job.
Title: Re: Post and PM Inline Attachments
Post by: Sectomy on July 17, 2020, 02:20:02 AM
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.
Title: Re: Post and PM Inline Attachments
Post by: 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.
Title: Re: Post and PM Inline Attachments
Post by: shadav on July 17, 2020, 06:07:03 PM
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
Title: Re: Post and PM Inline Attachments
Post by: Dave J on August 16, 2020, 04:00:12 AM
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
Title: Re: Post and PM Inline Attachments
Post by: 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']);
Title: Re: Post and PM Inline Attachments
Post by: Dave J on August 16, 2020, 08:03:19 AM
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.
Title: Re: Post and PM Inline Attachments
Post by: 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
Title: Re: Post and PM Inline Attachments
Post by: Dave J on August 16, 2020, 09:40:38 AM
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
Title: Re: Post and PM Inline Attachments
Post by: 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
Title: Re: Post and PM Inline Attachments
Post by: Dave J 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.
Title: Re: Post and PM Inline Attachments
Post by: 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.
Title: Re: Post and PM Inline Attachments
Post by: Dave J on August 17, 2020, 02:11:53 PM
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.
Title: Re: Post and PM Inline Attachments
Post by: 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.
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
Title: Re: Post and PM Inline Attachments
Post by: Sectomy on August 28, 2020, 08:02:33 AM
seems to be an impossible thing :o
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on August 29, 2020, 06:39:33 AM
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.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 01, 2020, 07:29:21 PM
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 (https://custom.simplemachines.org/mods/index.php?mod=4146) mod.
o Added support for Lazyload (https://custom.simplemachines.org/mods/index.php?mod=4259) mod.
o Added support for Images on Print Page (https://custom.simplemachines.org/mods/index.php?mod=2340) mod.
o Added support for SMFPacks Advanced Editor (https://www.smfpacks.com/wysiwyg/) mod.
o Removed support for SMF 2.1 (all versions).
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 02, 2020, 08:35:40 AM
Uploaded v6.18 - October 2, 2020
o Minor bug fix to v6.17.
o Improved integration with Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod.
Title: Re: Post and PM Inline Attachments
Post by: sam666 on October 11, 2020, 08:31:27 AM
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.
Title: Re: Post and PM Inline Attachments
Post by: 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?
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on December 20, 2020, 05:23:06 PM
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 (https://custom.simplemachines.org/mods/index.php?mod=1974) 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 (https://custom.simplemachines.org/mods/index.php?mod=1974) 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.
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on December 20, 2020, 05:59:37 PM
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.
Title: Re: Post and PM Inline Attachments
Post by: @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)). '" />

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on January 13, 2021, 06:01:25 AM
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 (https://www.simplemachines.org/community/index.php?topic=525705.msg4070592#msg4070592) made in October last year.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 02, 2021, 07:46:45 PM
Uploaded V7.00 - February 03, 2021
o Per stoneageman's (https://www.simplemachines.org/community/index.php?topic=525705.msg4070592#msg4070592) 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 (https://custom.simplemachines.org/mods/index.php?mod=2340) 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 (https://www.simplemachines.org/community/index.php?topic=418177.msg3499865#msg3499865) and Custom View of Attachments (https://dragomano.ru/mods/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 (https://custom.simplemachines.org/mods/index.php?mod=4131)
  o Who Downloaded Attachment (https://custom.simplemachines.org/mods/index.php?mod=4146)
  o Lazyload (https://custom.simplemachines.org/mods/index.php?mod=4259)
  o Highslide Image Viewer (http://custom.simplemachines.org/mods/index.php?mod=1450)
Title: Re: Post and PM Inline Attachments
Post by: 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?
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 03, 2021, 05:32:10 PM
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']),
Title: Re: Post and PM Inline Attachments
Post by: Dave J on February 04, 2021, 01:27:22 AM
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
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 04, 2021, 03:01:47 AM
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
Title: Re: Post and PM Inline Attachments
Post by: Dave J on February 04, 2021, 03:14:29 AM
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

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 05, 2021, 12:01:03 AM
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 ...
Title: Re: Post and PM Inline Attachments
Post by: Dave J on February 05, 2021, 02:49:03 AM
Hi GW,

I installed on my test site and it worked OK.

You were more than right about the left over of previous installs. I uninstalled v7.0 and tried to install v6.16 and had problems. So what I did then was deleted all site files and database and uploaded my backup from Monday night, including the database.

This should have resulted in the site going back to normal, however, because of the size of the 'attachments' folder I had omitted that from recent cron backups and after checking posts with images none of the images appeared. Still not realising the folder was missing, I uninstalled v6.16 and I went through evey file affect by all ILA versions, which included and old ILA-v1.21, I'd previously installed and found a lot of code that was still in the files.

Once I had done this I re-installed highslide and v7.0 and the install went OK except for one file which I then manually installed the code. This resulted in a good install but I still could not see the images only the place holders. Still not realising the missing folder I created a test post to see if it was a problem somewhere else and low and behold when I clicked on the post button the error came back saying the attachments folder was not writable, so that's when I found out the folder was missing.

At this moment I am waiting for my host to replace the folder from the server backups they do daily, it's going to cost me $25 but at least I'll have all the images back again, the most recent backup I had of that folder was 2019....that's a lot of missing images.

Needless to say I have now included the attachments folder in the next cron backup.

At this moment I think v7.0 will work OK. I haven't replaced the attachments folder yet because if I do that and the host looks they might think another engineer has done it and not bother, so everything is pending.

Thanks for all your replies and I will let you know if things are OK once I get the 'attachments' folder back. G'Day  ;)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 05, 2021, 04:16:26 AM
Wow - what an experience!

My hosting provider provides 1-2 hourly backups of all my forum content which are then made available in a range of increments (eg, all backups for last 24 hours, one backup per day for the previous week, and then one backup a week for the last month) for all of which I can access/restore via cPanel.

However, and because I don't want to totally reliant on any hosting provider (and because I was a Unix SysAdmin for +20 years),  I've written my own backup scripts which I use to backup all my forums every night to a facility in the US (costs me US$5 per month for 50Gb of storage) as follows:
One copy of all attachments;
A week's worth of forum folder backups;
A month's worth of database backups.

Good luck with your hosting company - hopefully they'll have all your attachments restored quickly.

And G'Day to you too!!


Title: Re: Post and PM Inline Attachments
Post by: Dave J on February 05, 2021, 05:18:19 AM
Quote from: GL700Wing on February 05, 2021, 04:16:26 AM
Wow - what an experience!

My hosting provider provides 1-2 hourly backups of all my forum content which are then made available in a range of increments (eg, all backups for last 24 hours, one backup per day for the previous week, and then one backup a week for the last month) for all of which I can access/restore via cPanel.

That must be a huge amount of storage they have for all those backups

Quote from: GL700Wing on February 05, 2021, 04:16:26 AM
However, and because I don't want to totally reliant on any hosting provider (and because I was a Unix SysAdmin for +20 years),  I've written my own backup scripts which I use to backup all my forums every night to a facility in the US (costs me US$5 per month for 50Gb of storage) as follows:
One copy of all attachments;
A week's worth of forum folder backups;
A month's worth of database backups.

I have a Synology NAS drive at home and I run XCloner3.5 on my site via a cron job to back up via FTP, as the site is very quiet I only need to back it up once a week so the storage, which also houses my music collection, doesn't cost me anything, apart from the initail outlay for the drive itself.

Quote from: GL700Wing on February 05, 2021, 04:16:26 AM
Good luck with your hosting company - hopefully they'll have all your attachments restored quickly.

Thanks again
Title: Re: Post and PM Inline Attachments
Post by: GigaWatt on February 05, 2021, 02:23:14 PM
Question: Will the BB code work in 2.1 if I install this in 2.0?
Title: Re: Post and PM Inline Attachments
Post by: @rjen on February 05, 2021, 03:37:22 PM
Find attached the updated dutch language files for the latest version
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 06, 2021, 04:19:03 AM
Uploaded v7.01 - February 06, 2021
o Fixed issue where images were not displayed in other topics for quoted 'attach', 'attachthumb' or 'attachmini' BBCodes.
o Minor bug fix relating to information displayed below 'attachurl' links.
o Bug fix relating to some thumbnail images not expanding as expected.
o Removed installation code introduced in v6.18 that allowed this mod to be installed after the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod.  The Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod must be installed after this mod (and it must be removed prior to uninstalling this mod).



IMPORTANT NOTE: In order to fully support the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod you must install this mod first!!
Also, if you subsequently need to uninstall this mod you must uninstall the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod beforehand.



Many thanks to @rjen for the Dutch language files (https://www.simplemachines.org/community/index.php?topic=525705.msg4081115#msg4081115).
Title: Re: Post and PM Inline Attachments
Post by: Dave J on February 15, 2021, 04:06:08 AM
Hi GL,

Just to let you know that the attachments folders, yes there were 2, are now back and 7.01 is working fine.

Thanks for all the help
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 15, 2021, 04:38:41 AM
Quote from: Dave J on February 15, 2021, 04:06:08 AM
Hi GL,

Just to let you know that the attachments folders, yes there were 2, are now back and 7.01 is working fine.

Thanks for all the help
Great news - and thanks for letting me know!
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on February 15, 2021, 05:24:17 PM
I've just discovered a minor issue that was introduced with v7.01 which will prevent image attachments from expanding if they are inserted with the 'attach' or 'attachmini' options.

Note:  As the v7.01 installer file had only been downloaded 2-3 times since it was released I'm suggesting the following fix/workaround until such time as the next version is released.

Either of the following fixes can be applied without it affecting the ability of the mod to be uninstalled at a later time:

Fix One:
In ./Sources/Subs-InlineAttachments.php - Line 1005
Find:
function ILA_subfunction($id, $full, $thumb, $name, $id_thumb = '', $style = '', $has_thumb = false, $expand = false)
Replace With
function ILA_subfunction($id, $full, $thumb, $name, $id_thumb = '', $style = '', $has_thumb = false, $expand = true)

Fix Two:
Replace your /Sources/Subs-InlineAttachments.php file with the attached Subs-InlineAttachments.php file.

I've also updated the v7.01 mod installer file.
Title: Re: Post and PM Inline Attachments
Post by: Dave J on February 16, 2021, 02:39:06 AM
Quote from: GL700Wing on February 15, 2021, 05:24:17 PM
I've just discovered a minor issue that was introduced with v7.01 which will prevent image attachments from expanding if they are inserted with the 'attach' or 'attachmini' options.

Note:  As the v7.01 installer file had only been downloaded 2-3 times since it was released I'm suggesting the following fix/workaround until such time as the next version is released.

Either of the following fixes can be applied without it affecting the ability of the mod to be uninstalled at a later time:

Fix One:
In ./Sources/Subs-InlineAttachments.php - Line 1005
Find:
function ILA_subfunction($id, $full, $thumb, $name, $id_thumb = '', $style = '', $has_thumb = false, $expand = false)
Replace With
function ILA_subfunction($id, $full, $thumb, $name, $id_thumb = '', $style = '', $has_thumb = false, $expand = true)

Fix Two:
Replace your /Sources/Subs-InlineAttachments.php file with the attached Subs-InlineAttachments.php file.

I've also updated the v7.01 mod installer file.

Hi GL,

I have already posted 'attach' images and they expand fine, have a look for yourself

https://www.davejohnson.co.uk/index.php?topic=435.msg844#new

This is the box after the decorating had been done

[attach=0]    [attach=1]
Title: Re: Post and PM Inline Attachments
Post by: Sectomy on March 05, 2021, 11:00:20 AM
i dont read the whole last pages, but, is there a possibility to make an "highslide" Mod into this, too ?
i mean, i installed that mod, only, for little Images and if you click on it, it shows full size....

isnt that an "standard" feature on most Forum Softwares ? :D
would be nice.... if it could be, or is it possible to install that mod after this mod again ? or dont do they work ?

greets
andi
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 05, 2021, 06:29:30 PM
Quote from: Sectomy on March 05, 2021, 11:00:20 AM
i dont read the whole last pages, but, is there a possibility to make an "highslide" Mod into this, too ?
i mean, i installed that mod, only, for little Images and if you click on it, it shows full size....

isnt that an "standard" feature on most Forum Softwares ? :D
would be nice.... if it could be, or is it possible to install that mod after this mod again ? or dont do they work ?

greets
andi
This mod supports three Highslide mods:
HS4SMF v0.8.1 (must be installed before ILA) (https://github.com/Spuds/SMF-HS4SMF)
Highslide Image Viewer (https://custom.simplemachines.org/mods/index.php?mod=1450)
JQLightBox (https://custom.simplemachines.org/mods/index.php?mod=1605)

I use the Highslide Image Viewer (https://custom.simplemachines.org/mods/index.php?mod=1450) mod (which can be installed either before or after this mod) on all my forums and it works perfectly.
Title: Re: Post and PM Inline Attachments
Post by: @rjen on July 13, 2021, 05:09:37 AM
On PHP 7.4 I am getting this error:

https://www.xxxx.xx/index.php?topic=16716.msg359904
8: Trying to access array offset on value of type null
File: /home/debxxxx/domains/xxxx.xx/public_html/Sources/Subs-InlineAttachments.php
Line: 280

It happen when a quote refers to a message with inline attachments and the original message has been deleted.

Seems to be a 7.4 issue, because the $row['id_board'] is returned with a FALSE...

SMF version 2.1.18
Mod version: 7.01
Title: Re: Post and PM Inline Attachments
Post by: @rjen on July 13, 2021, 05:56:00 AM
Quick fix...


$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);
$context['ila']['id_member'][$msg_id] = $row['id_member'] ?? '0';
$msg_board = (int) ($row['id_board'] ?? '0');
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on July 13, 2021, 07:48:17 AM
Quote from: @rjen on July 13, 2021, 05:56:00 AM
Quick fix...


$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);
$context['ila']['id_member'][$msg_id] = $row['id_member'] ?? '0';
$msg_board = (int) ($row['id_board'] ?? '0');

Many thanks @rjen for identifying the issue and the fix - I'll do some more testing with PHP 7.4 and then release an update.
Title: Re: Post and PM Inline Attachments
Post by: WolfJ on August 15, 2021, 04:54:13 AM
Sorry to be a bother but just setting up a fresh forum at the moment but seem to have run into a little issue. Even though I've set the attachment tag not to include the message at the end when I test and save the post to test it, it's still adding the msg part at the end adding the topic title on the right side of the image.

Did I do something wrong, I read the read me and did everything it asked. Checked the resizing and it's worked a treat just this one issue.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on August 15, 2021, 06:52:37 AM
Quote from: Legosi on August 15, 2021, 04:54:13 AM
Even though I've set the attachment tag not to include the message at the end when I test and save the post to test it, it's still adding the msg part at the end adding the topic title on the right side of the image.
Please post a screen capture of the inline attachment settings you are using and a screen capture of the issue you are seeing.
Title: Re: Post and PM Inline Attachments
Post by: ryry46d9 on August 27, 2021, 12:18:34 AM
Post and PM Inline Attachments Ver.7.01 
SMF Ver.2.0.18

I some how messed my forums up to where only the admin is able to (Insert Attachment) to a post.

I have looked over the board and member permissions but I am not seeing the issue.


ilbroken.PNG
attachments.PNG

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on August 27, 2021, 02:23:17 AM
Quote from: ryry46d9 on August 27, 2021, 12:18:34 AMPost and PM Inline Attachments Ver.7.01 
SMF Ver.2.0.18

I some how messed my forums up to where only the admin is able to (Insert Attachment) to a post.

I have looked over the board and member permissions but I am not seeing the issue.
There are no membergroup permissions for this mod - once the mod is installed anyone who can attach a file can also insert it inline.  Are non-admin members able to attach image/other files?

I have tested the mod and membergroup settings you are using on an SMF 2.0.18 forum with only version 7.01 of this mod installed (ie, no other mods installed) and I cannot reproduce the problem.

Please post an image of the 'Start new topic'/'Post reply' window with the 'Attachments and other options' section expanded.
PostReply_ILA.jpg

Please also post a list of any other mods and/or themes you have installed.
Title: Re: Post and PM Inline Attachments
Post by: ryry46d9 on August 28, 2021, 09:25:56 PM
sorry for the delay, I got busy

insert.PNG

as you see everything looks fine but when I try to add the picture nothing happens
 
when I add [attach id=0 msg=new] myself like
ADDED.PNG

I get
broken.PNG

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on August 29, 2021, 01:29:10 AM
Quote from: ryry46d9 on August 28, 2021, 09:25:56 PMas you see everything looks fine but when I try to add the picture nothing happens
If nothing happens when you click on 'Insert Attachment' this suggests a JavaScript conflict.

Also, the 'attach' tag you entered manually is not correct if you are modifying an existing message - that's why you are getting the error message you see in your last image (and you don't actually need the [/attach] closing tag).  To manually insert an attachment in an existing message you should use the tag [attach id=N] where N is the attachment number.

Some questions:
1. Was this mod ever working properly on your forum?
2. Can you uninstall this mod without any errors?
3. If this mod uninstalls without any errors can you then reinstall this mod without any errors?
4. Did you install any mods after this mod and, if so, what are those mods?
5. Have you tried to install/uninstall this mod multiple times?
Title: Re: Post and PM Inline Attachments
Post by: ryry46d9 on August 29, 2021, 03:42:49 PM
the mod works fine with the admin account which is where I got the code from.

I forgot to add all my mods

1.   SMF-20-fix_birthdate (uninstall before 2.0.19)   1.0
2.   Stop Spammer   2.4.0
3.   New Topic in Seperate Color   1.3
4.   SimplePortal   2.3.7
5.   Post and PM Inline Attachments   7.01

if I try to remove it I get. I currently am using the curve theme. the forums are new.
error.PNG
I uninstalled, removed and fetched a new version with same results 
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on August 29, 2021, 08:42:49 PM
Quote from: ryry46d9 on August 29, 2021, 03:42:49 PMthe mod works fine with the admin account which is where I got the code from.

I forgot to add all my mods

1.    SMF-20-fix_birthdate (uninstall before 2.0.19)    1.0
2.    Stop Spammer    2.4.0
3.    New Topic in Seperate Color    1.3
4.    SimplePortal    2.3.7
5.    Post and PM Inline Attachments    7.01
I've setup a brand new SMF 2.0.18 forum with all these mods installed and using the same settings for this mod but I still can't reproduce the problem.

Quoteif I try to remove it I get.
error.PNG
Your image attachment is missing.

Please post an image of the 'Start new topic' message window non-admin members see - example below.

Also, please post a copy of the ./Themes/Post.template.php file from your forum.


Title: Re: Post and PM Inline Attachments
Post by: ryry46d9 on August 29, 2021, 10:06:33 PM
what the user sees
user.PNG

what the admin sees
admin.PNG

the error I see (I probably forgot to insert)
error.PNG

the php file
Post.template.php
 
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on August 29, 2021, 10:33:46 PM
OK - I've confirmed that your Post.template.php file is correct.

The uninstall errors your posted are for the PersonalMessage.template.php file and would only be relevant if you had also installed the 'PM Attachments' (https://custom.simplemachines.org/index.php?mod=1974) mod - that's why you also see (Ignore Errors) after Test failed.

Would you please confirm that if a non-admin user clicks on the 'Choose File' button they can successfully select a file to attach and that they can also deselect the file by clicking on '(Clear Attachment)'.

Would you please let me know what computer/mobile device you are testing this on (eg, Windows/Mac/Linux computer or iOS/Android/Linux mobile device) and what browser you are using.

Finally, have you tested this issue using another browser and/or computer/mobile device?
Title: Re: Post and PM Inline Attachments
Post by: ryry46d9 on August 30, 2021, 05:07:26 PM
Quote from: GL700Wing on August 29, 2021, 10:33:46 PMOK - I've confirmed that your Post.template.php file is correct.

Then I really broke my forums  :'(

The uninstall errors your posted are for the PersonalMessage.template.php file and would only be relevant if you had also installed the 'PM Attachments' (https://custom.simplemachines.org/index.php?mod=1974) mod - that's why you also see (Ignore Errors) after Test failed.

That what I was thinking

Would you please confirm that if a non-admin user clicks on the 'Choose File' button they can successfully select a file to attach and that they can also deselect the file by clicking on '(Clear Attachment)'.

When I click on a file it will upload it and put them all at the bottom of the post either one can clear
 
Would you please let me know what computer/mobile device you are testing this on (eg, Windows/Mac/Linux computer or iOS/Android/Linux mobile device) and what browser you are using.

Android (S21ultra)Chrome win10(PC)Chrome win10(surface)Chrome

Finally, have you tested this issue using another browser and/or computer/mobile device?

I tried with Edge with the same results   

for right now I'm just going to give up, I have a lot of work that needs to get done. in a few weeks I'll come back to it.
It's very confusing everything I have looked at say it should just work.
I'll report back when I discover the problem.

Title: Re: Post and PM Inline Attachments
Post by: ryry46d9 on August 30, 2021, 07:30:26 PM
One thing I can add is,
when you click on a picture instead of it being larger it downloads it.

not sure if related or even helpful
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on August 30, 2021, 07:38:59 PM
Quote from: ryry46d9 on August 30, 2021, 05:07:26 PMfor right now I'm just going to give up, I have a lot of work that needs to get done. in a few weeks I'll come back to it.
It's very confusing everything I have looked at say it should just work.
I'll report back when I discover the problem.
PM sent.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on August 31, 2021, 11:29:14 PM
Quote from: ryry46d9 on August 30, 2021, 05:07:26 PMfor right now I'm just going to give up, I have a lot of work that needs to get done. in a few weeks I'll come back to it.
It's very confusing everything I have looked at say it should just work.
I'll report back when I discover the problem.
Woot!!  I just found out what's causing the issue on your forum - it's the WYSIWYG editor - if I disable the WYSIWYG editor in my profile on your forum I can insert images inline!

I've actually disabled it on all my forums because it has always been buggy ...

Administration Center » Posts and Topics » Post Settings » Disable WYSIWYG editor

Quote from: shadav on January 04, 2021, 04:27:44 PM... you can use wysiwyg and know that it is buggy and doesn't work correctly.....
unfortunately (if you search wysiwyg in the forums) it's not really fixable and well it's a pos and pita ...

I'll update the next release of the mod so that it disables the WYSIWYG editor when the mod is installed - looks like it's actually been a known issue for at least the last six years: Post and PM Inline Attachments (https://www.simplemachines.org/community/index.php?topic=525705.msg3821913;topicseen#msg3821913)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 01, 2021, 06:15:40 AM
Uploaded v7.02 - September 01, 2021
o Per ryry46d9 (https://www.simplemachines.org/community/index.php?msg=4096302) - disable WYSIWYG editor when mod is installed.
o Per @rjen (https://www.simplemachines.org/community/index.php?topic=525705.msg4091805#msg4091805) - fixed PHP 7.4 bug.
o Fixed bug introduced in v7.01 which prevented image attachments from expanding if they are inserted with the 'attach' or 'attachmini' options.
o Changed error message for when 'Allow quoted attachment images from another post?' option is disabled from 'You are not allowed to view this attachment' to 'Quoting of attachment images from other messages is not allowed'.
o Made some changes in Post.template.php to ensure consistent font sizing when installed with the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod.
o Other minor bug fixes.


** IMPORTANT NOTE: **
The SMF default WYSIWYG editor will be disabled when this mod is installed because if it is enabled the '(Insert Attachment)' link will not work.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 29, 2021, 02:31:49 AM
Uploaded v7.03 - September 29, 2021
o For print page view: added option to show inline images in the message body, and to show non-inline images and list non-image attachments below the message body.
  o If the 'Remove attachment image under post after inline use' option is not enabled images that are shown in the message body will also be shown below the message body.
  o Note: The Images on Print Page (https://custom.simplemachines.org/mods/index.php?mod=2340) mod MUST be uninstalled before this version is installed as this new feature replaces the functionality it provided in conjunction with enhancements added by earlier versions of this mod.
o Bug fix: Changed renumbering message for "Should first attachment be numbered 1?" from a 'confirmation' message to an 'alert' message because if 'Cancel' was clicked instead of 'OK' for the 'confirmation' message the inline attachment IDs in existing messages were not renumbered resulting in invalid and/or mismatched inline attachment IDs.
o Added 'Download link and counter setting' option to display filename, size and dimensions over three lines.
o Code improvements.
Title: Re: Post and PM Inline Attachments
Post by: @rjen on September 29, 2021, 04:58:02 PM
When I choose to renumber the attachments the process starts, then times out, and when restarting it gives e a 404 page... process does not resume/finish from the looks of it...
Title: Re: Post and PM Inline Attachments
Post by: @rjen on September 29, 2021, 05:03:55 PM
Hmm, after that I changed it back to 0 and saved and it seems to now have renumbered a fairly large number of inline attached to -1...

Effectively many inline attachments are now showing the wrong images ... thank god I tried it on a test forum and not on the productive forum. This function is dangerous with this bug in it...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 29, 2021, 06:59:17 PM
Quote from: @rjen on September 29, 2021, 05:03:55 PMHmm, after that I changed it back to 0 and saved and it seems to now have renumbered a fairly large number of inline attached to -1...

Effectively many inline attachments are now showing the wrong images ... thank god I tried it on a test forum and not on the productive forum. This function is dangerous with this bug in it...
Thanks for reporting this - I had tested this but only on a test forum that does not have very many inline attachments.

The renumbering function has been part of this mod for many years (and I didn't actually change the way it works in this release) but previously it displayed a confirmation message (ie, OK or Cancel) and I only discovered recently that if Cancel was clicked it changed the starting number for the 'Insert Attachment' button but did not renumber the attachment tags in existing messages which resulted in the issues you reported in this message.

I'll look into the timeout issue because I believe that's the primary cause of the problem ...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 30, 2021, 07:20:49 PM
Quote from: @rjen on September 29, 2021, 04:58:02 PMWhen I choose to renumber the attachments the process starts, then times out, and when restarting it gives e a 404 page... process does not resume/finish from the looks of it...
I've been working on this issue since you reported yesterday* and I discovered that the 404 error is caused by a bug in the code that has been there for at least six years (the oldest version of this mod I can find on my computer is v4.1 from August 2015 and the bug was there then).


* Initially I couldn't reproduce this problem using a copy of my largest forum so I had to actually add a whole lot of extra messages containing ILA tags to the messages table ...
Title: Re: Post and PM Inline Attachments
Post by: @rjen on September 30, 2021, 11:48:42 PM
I believe you: I never used the function before, but I tried it because you mentioned making changes to it in this version.

I personally believe in making a choice and sticking to that if there is no reason to change, so I never felt the need to change the numbering...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 01, 2021, 08:59:33 PM
Quote from: @rjen on September 30, 2021, 11:48:42 PMI believe you: I never used the function before, but I tried it because you mentioned making changes to it in this version.
I've only ever used it on test forums it because it was there but I've obviously never hit the processing limits that caused the 404 error before ...

QuoteI personally believe in making a choice and sticking to that if there is no reason to change, so I never felt the need to change the numbering...
Me too - leave well enough alone!

That said, and given that the option to change the numbering scheme is offered, the renumbering function should work otherwise it will corrupt the ILA tags in existing messages.

I've been working on a fix and it's currently working reliably with renumbering ILA tags in more than 8,000 messages in a database that has almost 170,000 messages (the renumbering is now done in batches of 250 messages whereas previously it was all done in one go).
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 04, 2021, 08:36:41 PM
Uploaded v7.04 - October 05, 2021
o Per @rjen (https://www.simplemachines.org/community/index.php?msg=4099516) - fixed bug that caused a '404' error when renumbering a large number of ILA tags.
o Changed code for renumbering ILA tags so that it now updates the database in batches of 250 modified messages instead of updating the database for all of the modified messages at once.
o Added warning message to 'Should first attachment be numbered 1?' advising that if this mod has previously been installed on a forum saving a change to this setting will cause inline attachment tags in all existing messages to be renumbered so the forum MUST be put into maintenance mode beforehand to ensure new inline attachments are not added to messages until after the renumbering process has finished.
Title: Re: Post and PM Inline Attachments
Post by: @rjen on October 05, 2021, 02:35:05 AM
The version in the xml has not been updated: it still states 7.03
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 05, 2021, 03:52:24 AM
Quote from: @rjen on October 05, 2021, 02:35:05 AMThe version in the xml has not been updated: it still states 7.03
Thanks (I was sure I'd checked/updated the XML files) - fixed now.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 18, 2021, 08:56:55 PM
Uploaded v7.05 - October 19, 2021
o Updated ./Sources/Subs-InlineAttachmentsAdmin.php to fix error condition that occurred when settings were saved.

Note: If you have already installed v7.04 of this mod you can upgrade to v7.05 without the need to uninstall v7.04.
Title: Re: Post and PM Inline Attachments
Post by: rcane on December 01, 2021, 09:00:15 AM
Good morning,

I have seen this error across many users when I'm tracking posts.


HI there,

Been using the mod for a while now (few months).  I've got around 900 users now, and I started seeing this today from one particular user:

Unable to load the 'PMAttachments.english' language file.


Any guidance or ideas?
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on December 01, 2021, 06:05:56 PM
Quote from: rcane on December 01, 2021, 09:00:15 AMGood morning,

I have seen this error across many users when I'm tracking posts.


HI there,

Been using the mod for a while now (few months).  I've got around 900 users now, and I started seeing this today from one particular user:

Unable to load the 'PMAttachments.english' language file.


Any guidance or ideas?

The issue you're reporting is not for this mod - it's for the 'PM Attachments (https://custom.simplemachines.org/index.php?mod=1974)' mod.

Make sure the relevant English language files exist - including the 'utf8' version if you're forum has been converted to UTF - in the languages directory/folder and that the files have the correct access permissions.
Title: Re: Post and PM Inline Attachments
Post by: andy12gr on March 19, 2022, 05:21:07 AM
After install this mod i have in the end of any post the below message
the problem is the theme manas not the default
my site is https://stray-animals.com
An Error Has Occurred!
Call to undefined function loadreactionemojis


look at one of post
https://stray-animals.com/index.php?topic=270.0
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 19, 2022, 06:15:56 AM
Quote from: andy12gr on March 19, 2022, 05:21:07 AMAfter install this mod i have in the end of any post the below message
the problem is the theme manas not the default
my site is https://stray-animals.com
An Error Has Occurred!
Call to undefined function loadreactionemojis


look at one of post
https://stray-animals.com/index.php?topic=270.0
The issue you're reporting is not for this mod - it's for the 'SMF Versatile Post Reactions' (https://custom.simplemachines.org/index.php?mod=4264) mod (and I suspect it's being caused by that mod not being correctly installed/uninstalled) ...
Title: Re: Post and PM Inline Attachments
Post by: andy12gr on March 19, 2022, 06:26:31 AM
thanks...its ok now  ;D
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on March 19, 2022, 09:22:45 AM
If this mod could somehow be transitioned to 2.1.1 it would be VERY helpful.

I have 10 years or so of this mods tags thrown throughout the forum.  Updating to 2.1.1. broke `em all. 

Frankly,  I'm not sure why the team decided NOT to go with this route for 2.1.1... but they didn't... and as a result there are thousands of pages on my forum with bogus tags and images sitting down in the bottom of the posts.

Any chance this mod gets updated to work with 2.1.1?
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on March 20, 2022, 09:17:49 PM
Quote from: FrizzleFried on March 19, 2022, 09:22:45 AMIf this mod could somehow be transitioned to 2.1.1 it would be VERY helpful.

I have 10 years or so of this mods tags thrown throughout the forum.  Updating to 2.1.1. broke `em all. 

Frankly,  I'm not sure why the team decided NOT to go with this route for 2.1.1... but they didn't... and as a result there are thousands of pages on my forum with bogus tags and images sitting down in the bottom of the posts.

Any chance this mod gets updated to work with 2.1.1?
@FrizzleFried  I hadn't planned on updating this mod for 2.1.x because that release already has an inline attachments feature ...

However, I hadn't considered what would happen with the existing ILA BBCode tags created by this mod when a forum is upgraded from 2.0.x to 2.1.x but clearly there is a need for an updated version of this mod even if only to display the existing ILA BBCode tags correctly (and to renumber/delete them when an attachment is removed).

I've started looking into what's involved in creating a new version specifically for 2.1.x but due to the attachments handling process in 2.1.x being so different to 2.0.x, plus some other mods that also need updating for 2.1.1, plus some planned leave I have for the next two weeks, it will probably take me until mid-late April to have something ready.
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on March 21, 2022, 01:17:42 AM
Take your time... we'll live with the tags for now...

:)

Thank you!
Title: Re: Post and PM Inline Attachments
Post by: andy12gr on April 01, 2022, 02:40:44 AM
I cant see the first photos in posts when i put link from my site to facebook, i hope you understand my poor english.
This problem is from facebook or mod? (all my photos in posts are attachments)

Thanks for mod is great!!
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 22, 2022, 12:08:48 AM
Version v7.06 - April 22, 2022
o Added support for SMF 2.1 (NOTE:  SMF 2.1 will NOT be supported for inserting attachments inline by this mod):
  - Provide backward display and print page compatability for ILA BBCodes in existing posts of forums that used this mod prior to being upgraded from SMF 2.0; and
  - Add Print Page image layout/formatting the same as when this mod was installed on SMF 2.0.

o SMF 2.1: Important note for forums that used this mod with SMF 2.0
  - Unfortunately, and because a message may contain a mix of ILA BBCodes and native SMF 2.1 BBCodes for attachments that are inserted inline, it is not possible to remove an obsolete ILA BBCode (eg, [attach id=4 msg=5678]) from the body of a message when an attachment is deleted.
    Therefore, if an attachment that was inserted inline into a message by this mod is subsequently deleted the message must be saved and then edited again to remove the ILA BBCode that refers to the deleted attachment (eg, [attach id=4 msg=5678]) before more attachment are added to the message.
    If this procedure isn't followed the text "[ Invalid Attachment ]" may appear when the message is displayed/printed and/or if another attachment is added it will be displayed/printed in the message using the ILA BBCode (eg, [attach id=4 msg=5678]) that refers to the deleted attachment.

o Fixed bug introduced in v7.03 that prevented the (Insert Attachment N) link being displayed for second and subsequent attachments in PMs (only relevant if PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974) mod is installed).

o Fix for 'Undefined index: webm' error in ./Sources/Subs-InlineAttachments.php.

o Added support for 'SCEditor Integration for SMF 2.0.x' (https://custom.simplemachines.org/index.php?mod=4319) mod.
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 12:53:52 AM
To be clear... you do not plan to implement ILA attachments for 2.1.1 ever with this mod... it's just more or less to clean up the tags for the 2.0.x sites that upgraded?

If this is correct... I must admit I am a little disappointed.  If I am not,  please clarify.

Thanks!

:)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 22, 2022, 12:59:30 AM
Quote from: FrizzleFried on April 22, 2022, 12:53:52 AMTo be clear... you do not plan to implement ILA attachments for 2.1.1 ever with this mod... it's just more or less to clean up the tags for the 2.0.x sites that upgraded?

If this is correct... I must admit I am a little disappointed.  If I am not,  please clarify.
Yes - because inline tags are a standard feature of SMF 2.1 so I don't see any point in trying to duplicate something that is already there ...
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 01:08:53 AM
I'd argue that your system is more intuitive and takes up much less "real estate" especially when dealing with many large images.  It's a preference thing.  Just know that you'd have at least one download if you were to implement your system in to 2.1.1...

Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 01:09:28 AM
...oh,  and of course there is no attachments in 2.1.x PM's...

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 22, 2022, 01:49:18 AM
Quote from: FrizzleFried on April 22, 2022, 01:08:53 AMI'd argue that your system is more intuitive and takes up much less "real estate" especially when dealing with many large images.  It's a preference thing.  Just know that you'd have at least one download if you were to implement your system in to 2.1.1...
Sorry to disappoint but I think it's beyond me to rewrite this mod to replace the attachment upload and inline insert system used by SMF 2.1 - plus of course there would be the need for ongoing support and updates when a new version of SMF 2.1 is released.

Quote from: FrizzleFried on April 22, 2022, 01:09:28 AM...oh,  and of course there is no attachments in 2.1.x PM's...
True - but that was done by a different mod in SMF 2.0 anyway ...
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 08:44:09 AM
Well... life goes on.  Maybe someone will come by and improve the current inline attachment system.

I've asked a couple times but no one has answered.  Any idea why we need that extra "UPLOAD" step in the current system?   When selecting a file,  it should upload automatically.  Requiring that extra step (pushing the upload button) adds confusion... (of course once you do it once right the confusion ends)... and an extra step... and I don't know about you but I know I am tired as hell (in work) being forced in to a new software solution (I know,  I am not being forced with 2.1.x... just follow me because you know what I am talking about)....ahem... FORCED in to a new software solution that requires 5 clicks to do what you used to do in 2...

:D

And get off my lawn!!!

;)

Title: Re: Post and PM Inline Attachments
Post by: Arantor on April 22, 2022, 08:56:30 AM
I don't get why the extra click either to be honest.
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 12:06:05 PM
With my 2.1.1 site... do i need to do something to get this to work?   Do I need to run that script that I need to put my site in the maintenance mode to run?

I ask as I did install... no issues... but none of my inline attachment links are showing the inline attachments...

They remain at the bottom as "normal"...
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 04:04:33 PM
I am also getting this error from what I believe is the auto-rotate mod once I installed this mod...

I had none prior... and the errors appeared just after installing.

Here is the error... I can't say if it's related 100% or not but I suspect it is.

:(

8: Undefined index: thumb_mime
Backtrace:

#0: smf_error_handler()
Called from /home/ahaforum/public_html/Sources/Subs-AutoRotation.php on line 490
#1: AutoRotation_DisplayDownload()
Called from /home/ahaforum/public_html/Sources/Subs-Attachments.php on line 1284
#2: loadAttachmentContext()
Called from /home/ahaforum/public_html/Sources/Subs-InlineAttachments.php on line 334
#3: ILA_Post_Attachments()
Called from /home/ahaforum/public_html/Sources/Subs-InlineAttachments.php on line 166
#4: ILA_Setup()
Called from /home/ahaforum/public_html/Sources/Subs.php on line 2577
#5: parse_bbc()
Called from /home/ahaforum/public_html/Sources/Class-SimTopics.php on line 261
#6: checkTopicsOnDisplay()
Called from /home/ahaforum/public_html/Sources/Class-SimTopics.php on line 53
#7: menuButtons()
Called from /home/ahaforum/public_html/Sources/Subs.php on line 5768
#8: call_integration_hook()
Called from /home/ahaforum/public_html/Sources/Subs.php on line 5573
#9: setupMenuContext()
Called from /home/ahaforum/public_html/Sources/Subs.php on line 4351
#10: setupThemeContext()
Called from /home/ahaforum/public_html/Sources/Subs.php on line 4516
#11: template_header()
Called from /home/ahaforum/public_html/Sources/Subs.php on line 4151
#12: obExit()
Called from /home/ahaforum/public_html/index.php on line 190
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 22, 2022, 07:36:57 PM
Quote from: FrizzleFried on April 22, 2022, 04:04:33 PMI am also getting this error from what I believe is the auto-rotate mod once I installed this mod...
Based on the line number in ./Subs-AutoRotation.php it looks like you're not using the latest version of the Automatic Attachment Rotation and (Resize) mod - if you get a chance would you please upgrade to v6.13 and let me know if the issue persists ...
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 07:37:38 PM
Will try that now...

EDIT: Actually... gotta pick up dinner then we're watching a movie so it'll be later tonight when I can install and test...

I will report back.
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 10:35:14 PM
Unfortunately I can report that with the 6.13 version of the Auto-Rotation mod installed I am still getting the error generated while this mod is installed AND I am not getting any of the images actually appearing in-line unfortunately.


Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 10:37:59 PM
Type of error: Undefined
Error messageSelect
8: Undefined index: thumb_mime
35

 Today at 07:33:48 PM
 FrizzleFried
 xxx
 992d2a039e0fa1c801da5b724d06182a
 https://www.NOFOLLOW.com/index.php?topic=4.16360
 /home/ahaforum/public_html/Sources/Subs-AutoRotation.php (Line 507)  Backtrace information


Backtrace:

#0: smf_error_handler()
Called from /home/ahaforum/public_html/Sources/Subs-AutoRotation.php on line 507
#1: AutoRotation_DisplayDownload()
Called from /home/ahaforum/public_html/Sources/Subs-Attachments.php on line 1281
#2: loadAttachmentContext()
Called from /home/ahaforum/public_html/Sources/Subs-InlineAttachments.php on line 334
#3: ILA_Post_Attachments()
Called from /home/ahaforum/public_html/Sources/Subs-InlineAttachments.php on line 166
#4: ILA_Setup()
Called from /home/ahaforum/public_html/Sources/Subs.php on line 2577
#5: parse_bbc()
Called from /home/ahaforum/public_html/Sources/Display.php on line 1533
#6: prepareDisplayContext()
Called from /home/ahaforum/public_html/Themes/default/Display.template.php on line 267
#7: template_main()
Called from /home/ahaforum/public_html/Sources/Load.php on line 2757
#8: loadSubTemplate()
Called from /home/ahaforum/public_html/Sources/Subs.php on line 4156
#9: obExit()
Called from /home/ahaforum/public_html/index.php on line 190


Different...
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 22, 2022, 10:53:00 PM
...and again,  when the ILA mod is uninstalled,  the errors go away it seems.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 22, 2022, 11:59:16 PM
Quote from: FrizzleFried on April 22, 2022, 10:53:00 PM...and again,  when the ILA mod is uninstalled,  the errors go away it seems.
Working on it ...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 23, 2022, 02:02:12 AM
Deleted v7.06 release as it was not playing nicely with the [attach] tag introduced in  SMF 2.1 when editing messages ...

Back to the drawing board ...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 27, 2022, 02:21:00 AM
Version v7.06 - April 27, 2022
o Added support for SMF 2.1 (NOTE:  SMF 2.1 will NOT be supported for inserting attachments inline by this mod):
  - Provide backward display and print page compatability for ILA BBCodes in existing posts of forums that used this mod prior to being upgraded from SMF 2.0; and
  - Add Print Page image layout/formatting the same as when this mod was installed on SMF 2.0.

o SMF 2.1: Important note for forums that used this mod with SMF 2.0
  - Unfortunately, and because a message may contain a mix of ILA BBCodes and native SMF 2.1 BBCodes for attachments that are inserted inline, it is not possible to remove an obsolete ILA BBCode (eg, [attach id=4 msg=5678]) from the body of a message when an attachment is deleted.
    Therefore, if an attachment that was inserted inline into a message by this mod is subsequently deleted the message must be saved and then edited again to remove the ILA BBCode that refers to the deleted attachment (eg, [attach id=4 msg=5678]) before more attachment are added to the message.
    If this procedure isn't followed the text "[ Invalid Attachment ]" may appear when the message is displayed/printed and/or if another attachment is added it will be displayed/printed in the message using the ILA BBCode (eg, [attach id=4 msg=5678]) that refers to the deleted attachment.

o Fixed bug introduced in v7.03 that prevented the (Insert Attachment N) link being displayed for second and subsequent attachments in PMs (only relevant if PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974) mod is installed).

o Fix for 'Undefined index: webm' error in ./Sources/Subs-InlineAttachments.php.

o Added support for 'SCEditor Integration for SMF 2.0.x' (https://custom.simplemachines.org/index.php?mod=4319) mod.



Note
For SMF 2.0 forums using versions 7.04 or 7.05 there are upgrade options to version 7.06 - it is not necessary to uninstall these versions (ie, 7.04 or 7.05) beforehand.
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 27, 2022, 10:17:05 AM
First...

The GOOD News... No errors that I am encountering.


The BAD News... Inline attachments are not happening... tags are still visible... images are still down bottom.

:(

Do I have to run this operation to get things to work?

QuoteShould first attachment be numbered 1?
Important note if this mod has previously been installed on this forum:
Saving a change to this setting will cause inline attachment tags in all existing messages to be renumbered so you MUST put the forum into maintenance mode beforehand to ensure new inline attachments are not added to messages until after the renumbering process has finished!


FWIW I noticed that the first attachment on each post IS numbered 1...

EDIT: I also have to point out that this is on a forum that used to be 2.0.x running this mod and now runs 2.1.x... I can't test this particular mod in my sandbox because I have no old ILA tags on that system to test with...   :)

My current site is running 24 mods... some being other embed type mods.  There could be a conflict I assume.


Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 27, 2022, 11:20:04 PM
Quote from: FrizzleFried on April 27, 2022, 10:17:05 AMFirst...

The GOOD News... No errors that I am encountering.

The BAD News... Inline attachments are not happening... tags are still visible... images are still down bottom.
OK - I've just repeated the process of migrating a forum from SMF 2.0.19 to SMF 2.1.1 and I cannot reproduce the issue you reported ...
SMF 2.0.19 with ILA v7.06
SMF_2.0.19.jpg

SMF 2.1.1 without ILA
SMF_2.1.1-1.jpg

SMF 2.1.1 with ILA v7.06
SMF_2.1.1-2.jpg 

QuoteDo I have to run this operation to get things to work?
Nope - nothing needs to be changed.

QuoteMy current site is running 24 mods... some being other embed type mods.  There could be a conflict I assume.
If you let me know which other mods you're using I'll try and reproduce the issue and then work out if I can resolve it ...
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on April 28, 2022, 12:02:14 AM
Hello...

I am heading in to a short vacation for 3 days...   Will be back Saturday evening...

Here is a quick CUT/PASTE of the mods I am running.

1 Fix for Ignore boards function in 2.1.1
2 Stupid bouncy BBC 2.0
3 Quick Reply Attachments Button
4 Post and PM Inline Attachments
5 Alert Behaviours 1.0
6 Happy Birthday 0.4
7 FancyBox 4 SMF 1.1.1
8 Smart Pagination 1.2
9 Automatic Attachment Rotation (and Resize) 6.13
10 Forum Width Setting 1.2
11 Custom Greeting 3.0
12 Voter Visibility 2.1
13 SMF Arcade 2.6.7
14 Awesome Post Ratings 2.0.3
15 Users Online Today 2.1.1
16 Badge Awards2.6.2a
17 TinyPortal 2.2.1
18 Activity Bar 2.0.1
19 Arantor Sidebar 1.0.1
20 Avatars Display Integration 1.5.1
21 Curve2 Color Changer 1.4
22 Quick Spoiler 1.5
23 Link Previews 1.0.2
24 Similar Topics 1.2.1
25 SMFPacks Media Embedder 1.0.9
26 PM Attachments 2.12
27 Display Signatures Only Once Per Page 1.0.3

I suspect the culprits could be the Link Previews 1.0.2 mod or the SMF Packs Media Embedder...

But what do I know?

:)

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 28, 2022, 02:33:52 AM
Quote from: FrizzleFried on April 28, 2022, 12:02:14 AMI suspect the culprits could be the Link Previews 1.0.2 mod or the SMF Packs Media Embedder...
Not sure I can help - I'd have to buy a copy of both those mods in order to be able to test them ...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on April 28, 2022, 10:47:36 PM
Quote from: FrizzleFried on April 28, 2022, 12:02:14 AMI suspect the culprits could be the Link Previews 1.0.2 mod or the SMF Packs Media Embedder...
@live627 - wondering if I can get a copy of the Link Previews (https://mods.live627.com/mods/link-previews/) mod for troubleshooting the ILA issue @FrizzleFried is having.

@Nibogo - wondering if I can get a copy of the SMFPacks Auto Media Embedder (https://www.smfpacks.com/embedder/) mod for troubleshooting the ILA issue @FrizzleFried is having.

Note:  If you provide me with a copy of these mods I will only install them on my test site and use them for compatibility testing/troubleshooting purposes (they will not be installed on any of my production sites/forums).  Also, I will uninstall these mods once I have finished with them for troubleshooting this ILA issue.
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on May 01, 2022, 09:25:34 AM
Back from California's Great America amusement park and in pain (evidently 50 years old is too old for roller coasters)...

One thing I can do to trouble shoot is uninstall each mod individually on my site to see if the ILA's start working.  If I uninstall one and they start working... BOOM,  that's the problematic mod.

I'll start with the two paid mods above.

Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on May 01, 2022, 09:34:45 AM
Unfortunately it is NEITHER of those two paid mods.   Both removed... same situation.  Images showing at bottom... tags showing in posts...

:(

I guess I will have to go through each of them to try to determine which it is.
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on May 01, 2022, 10:02:40 AM
I did find these error in my log from yesterday...

CrazyKongFan
 172.58.140.70
 72ad4a1d63d57a3feebe1bd182a74911
 https://www.NOFOLLOW.com/index.php?action=profile;area=showposts;sa=attach;u=26;sort=posted;desc;start=15
 /home/ahaforum/public_html/Sources/Subs-InlineAttachments.php (Line 1267)  Backtrace information

Type of error: General
Error messageSelect
2: Invalid argument supplied for foreach()
22

 Yesterday at 06:35:15 AM
 CrazyKongFan
 172.58.140.70
 72ad4a1d63d57a3feebe1bd182a74911
 https://www.NOFOLLOW.com/index.php?action=profile;area=showposts;sa=attach;u=26;sort=posted;desc;start=15
 /home/ahaforum/public_html/Sources/Subs-InlineAttachments.php (Line 1267)  Backtrace information

Type of error: Undefined
Error messageSelect
8: Undefined index: attachment

Backtraces:

#0: smf_error_handler()
Called from /home/ahaforum/public_html/Sources/Subs-InlineAttachments.php on line 1267
#1: ILA_Below_Post_Show()
Called from /home/ahaforum/public_html/Sources/Subs.php on line 5768
#2: call_integration_hook()
Called from /home/ahaforum/public_html/Sources/Subs-List.php on line 40
#3: createList()
Called from /home/ahaforum/public_html/Sources/Profile-View.php on line 1331
#4: showAttachments()
Called from /home/ahaforum/public_html/Sources/Profile-View.php on line 870
#5: showPosts()
Called from /home/ahaforum/public_html/Sources/Profile.php on line 844
#6: ModifyProfile()
Called from /home/ahaforum/public_html/index.php on line 187
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 01, 2022, 08:46:18 PM
Quote from: FrizzleFried on May 01, 2022, 10:02:40 AMI did find these error in my log from yesterday...
OK - that's a simple one and it seems to only occur in SMF 2.1 when attachments are being viewed via the member profile.

Simple fix which I'll add to the next release and which won't impact you ability to uninstall the mod if you need to.

In ./Sources/Subs-InlineAttachments.php
Find:
function ILA_Below_Post_Show(&$message)
{
    global $context, $modSettings, $scripturl, $settings, $sourcedir, $txt, $user_info;

Add After:

    if (empty($message['attachment']))
        return;

Unfortunately this doesn't explain why attachments aren't being displayed inline in posts though - will send you a PM ...
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 06, 2022, 07:36:47 AM
Hello :)
I'm testing this Mod on a local copy of the forum and I can install it and try, but not when doing this on an online forum.
As soon as (it takes time to figure out the culprit) the file is copied in \Sources folder, the website goes to HTTP Error 500.

I have no clue why it happens, but for sure there is a cause.
Thanks.
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 06, 2022, 10:18:49 AM
Hello again :)

Did I forget to past the name of the file, it seems so :
Quote./Sources/Subs-InlineAttachments.php
Thanks.

Quote from: Sebastiii on May 06, 2022, 07:36:47 AMAs soon as (it takes time to figure out the culprit) the file is copied in \Sources folder, the website goes to HTTP Error 500.
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 06, 2022, 11:18:11 AM
Quote from: @rjen on December 30, 2017, 12:46:45 PMInstalling version 6.2 on my test site results in HTTP ERROR 500
Hi,
Did you know/remember what happen for this error ?
Thanks.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 06, 2022, 05:42:20 PM
Quote from: Sebastiii on May 06, 2022, 11:18:11 AM
Quote from: @rjen on December 30, 2017, 12:46:45 PMInstalling version 6.2 on my test site results in HTTP ERROR 500
Hi,
Did you know/remember what happen for this error ?
Thanks.
Please try using the latest version of the mod.
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 07, 2022, 03:56:12 AM
Quote from: GL700Wing on May 06, 2022, 05:42:20 PMPlease try using the latest version of the mod.
Hello, what do you mean by using the latest version ?
Effectively, I wasn't enough clearly in my bug report :(
I'm using 2.0.19 SMF version and 7.06 (Post_and_PM_Inline_Attachments_v7.06.zip) version.

And I'm getting HTTP ERROR 500 on the online production but not in my local copy of SMF to test plugins before installing it online.

Thanks.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 07, 2022, 04:40:41 AM
Quote from: Sebastiii on May 07, 2022, 03:56:12 AMHello, what do you mean by using the latest version ?
Effectively, I wasn't enough clearly in my bug report :(
In your previous message you stated you were installing version 6.2 ...

QuoteI'm using 2.0.19 SMF version and 7.06 (Post_and_PM_Inline_Attachments_v7.06.zip) version.

And I'm getting HTTP ERROR 500 on the online production but not in my local copy of SMF to test plugins before installing it online.
Ok - please download and install version 7.05 and let me know if you have the same issue with that version.

PS: I'm currently away from home and won't have access to my test system until Tuesday or Wednesday next week ...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 07, 2022, 04:43:01 AM
Quote from: Sebastiii on May 07, 2022, 03:56:12 AMHello, what do you mean by using the latest version ?
Effectively, I wasn't enough clearly in my bug report :(
In your previous message I thought you were also installing version 6.2 ...

That version was released before I was involved in updating this mod so I don't know what the cause and/or fix were ...

QuoteI'm using 2.0.19 SMF version and 7.06 (Post_and_PM_Inline_Attachments_v7.06.zip) version.

And I'm getting HTTP ERROR 500 on the online production but not in my local copy of SMF to test plugins before installing it online.
Ok - please download and install version 7.05 and let me know if you have the same issue with that version.

PS: I'm currently away from home and won't have access to my test system until Tuesday or Wednesday next week ...
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 07, 2022, 04:46:47 AM
Quote from: GL700Wing on May 07, 2022, 04:40:41 AMIn your previous message you stated you were installing version 6.2 ...
Ok, I see, I was quoting an older message with the same issue and the version was 6.2 in this quote.
Sorry for this :)

QuoteOk - please download and install version 7.05 and let me know if you have the same issue with that version.

PS: I'm currently away from home and won't have access to my test system until Tuesday or Wednesday next week ...
Ok I will try it and report back need to have correct backup and I will do it.
It looks like kind of permission issue maybe, because locally, I'm using the same DB and forum folder files (but local is windows with WAMP with same PHP version).
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 07, 2022, 05:21:41 AM
Quote from: GL700Wing on May 07, 2022, 04:43:01 AMOk - please download and install version 7.05 and let me know if you have the same issue with that version.
Same and even worst, because even if I remove "Subs-InlineAttachments.php" the HTTP ERROR 500 is always present now.
No clue where is this issue !
Thanks.
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 07, 2022, 05:46:40 AM
@GL700Wing
With 7.05, the forum is back if I:
1- Rename the file "Subs-InlineAttachments.php" to whatever "Subs-InlineAttachments.php.broken" for ex.
2- Restore "Subs.php" the one before installing the plugin.

But with the "Subs.php" restored and if I rename back "Subs-InlineAttachments.php.broken" to "Subs-InlineAttachments.php", the HTTP 500 ERROR is back again.

With 7.06, just renaming "Subs-InlineAttachments.php" to "Subs-InlineAttachments.php.broken" is enough to get rid of the HTTP 500 ERROR, but the plugin doesn't work, and it's logic :D

So looking in the "Subs.php" from 7.05 and it calls the "function ILA_Setup($msg_id, &$message)...." where it does differently in 7.06

7.06 :
Quote// Post and PM Inline Attachments mod.
    global $sourcedir;
    if (file_exists($sourcedir . '/Subs-InlineAttachments.php'))
        ILA_Setup($cache_id, $message);

7.05 :
Quote// Post and PM Inline Attachments mod.
    ILA_Setup($cache_id, $message);

So, it can explain why in 7.06 renaming the file maybe back the forum online again ;)
The part of the issue seems to be in "ILA_Setup" code from "/Subs-InlineAttachments.php".

Now why ? :)

Let's see if we can figure out when you will be back :)

PS : I have duplicated the online forum into another directory and with a copy of the DB, like this I can try online without broken the current working SMF forum :)

Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 07, 2022, 06:01:14 AM
Ok, figure out what line makes the error (based on 7.05) :
In 'function ILA_Post_Attachments($msg_id)' from ".\Subs-InlineAttachments.php"
When I comment those 2 lines (need to be both line):

Quote//$context['ila']['id_member'][$msg_id] = $row['id_member'] ?? '0';
//$msg_board = (int) ($row['id_board'] ?? '0');

Forum is back online (no ERROR 500).
Maybe there is a syntax that is not correct ?
No clue to check that by debugging but it's related to those line and I don't know if you request is elsewhere (surely not) because the forum didn't show up HTTP ERROR 500.

I will try on 7.06, but I'm pretty sure it will be the same result.

Edit : Installing 7.06 and commented out those 2 above lines and forum is back.
There is to do with syntax it seems, maybe related to PHP settings somehow.
Title: Re: Post and PM Inline Attachments
Post by: Arantor on May 07, 2022, 06:17:19 AM
What version of PHP are you using?
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 07, 2022, 06:59:24 AM
Quote from: Arantor on May 07, 2022, 06:17:19 AMWhat version of PHP are you using?
I'm using 5.6 version, maybe I should change to a more recent one ?
I wouldn't break my forum but upgrading it.
Title: Re: Post and PM Inline Attachments
Post by: Arantor on May 07, 2022, 07:05:06 AM
The ?? syntax doesn't exist in PHP 5.6 which is why you get the errors you do, and PHP 5.6 is years out of date at this point. (PHP team is working on releasing 8.2 this year.)

SMF 2.0 series is good up to PHP 7.4, your mods may not be though.
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 07, 2022, 07:12:08 AM
@Arantor
I will set it to PHP 7.4 then, and it will fix this issue for sure.
Will report back.
Thanks :)
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 07, 2022, 07:29:31 AM
@Arantor @GL700Wing
It works, :) So it was related to the syntax not compatible with 5.6 like you said.
Thanks.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 07, 2022, 07:06:20 PM
Quote from: Arantor on May 07, 2022, 07:05:06 AMThe ?? syntax doesn't exist in PHP 5.6 which is why you get the errors you do, and PHP 5.6 is years out of date at this point. (PHP team is working on releasing 8.2 this year.)

SMF 2.0 series is good up to PHP 7.4, your mods may not be though.
@Arantor - many thanks for your help with this as it would have taken me a while to work out the cause of the issue on my own.

Even though PHP 5.x is very old I'm thinking of updating the code for this mod and another mod I co-author to ensure compatibility across PHP 5.x, 7.x and 8.x ...
Title: Re: Post and PM Inline Attachments
Post by: Arantor on May 07, 2022, 07:24:44 PM
I'm on the fence about the idea personally. While I appreciate people are stuck on older hosts sometimes, I'd honestly rather see the effort go into bringing things up to current-supported rather than supporting-phased-out.

I tend to look at Ubuntu as the benchmark here as a distribution that moves at a reasonable pace and keeps older versions around, and even then... well, let's just take a look:

Ubuntu 14.04 - support ended April 2019 - baseline is PHP 5.5
Ubuntu 16.04 - support ended April 2021 - baseline is PHP 7.0
Ubuntu 18.04 - support ends April 2028 - baseline is PHP 7.2
Ubuntu 20.04 - support ends April 2030 - baseline is PHP 7.4
Ubuntu 22.04 - support ends April 2032 - baseline is PHP 8.1

(Prior to Ubuntu 18.04, LTS was 5 years. As of 18.04, it is 10 years. This means Ubuntu team or someone affiliated with them will be backporting patches to these versions of the platform. You can assume then that PHP 7.2+ will be hanging around for a while.)

At this point supporting PHP below 7.0 is increasingly a tall ask for any project, I feel.
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 08, 2022, 05:47:13 AM
Hello,
I have few point for you :)

Point 1)
I'm getting locally and online those errors :

http://127.0.0.1/public_html/forum/index.php?pretty;board=journaux-de-reves;topic=journal-d-emilllie-part2.0
2: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Fichier: C:/wamp64/www/public_html/forum/Themes/default/languages/InlineAttachments.english.php (eval?)
Ligne: 3855

http://127.0.0.1/public_html/forum/index.php?pretty;board=journaux-de-reves.0
2: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Fichier: C:/wamp64/www/public_html/forum/Themes/default/MessageIndex.template.php (eval?)
Ligne: 3855

Each time a page is loaded, I'm getting this many times in a row, so this is a lot of error like you can see.
So there are more than 10000 errors logs.

Point 2)
Also, I'm using this mod that make conflict : https://custom.simplemachines.org/index.php?mod=3818
An older version, so it seems (1.5 where it's 2.0.3 now)

Point 3)
In Tapatalk, Inline image are ok in post but appear also at the bottom, this means we can see duplicate image in the post from Tapatalk App.

Thanks.
Title: Re: Post and PM Inline Attachments
Post by: Arantor on May 08, 2022, 05:49:58 AM
The second error is in a board, not a topic - seems unlikely it would be this mod. Turn off eval to see where the errors really are - probably not this mod though.
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 08, 2022, 06:01:59 AM
@Arantor
What do you mean to Turn off eval or how I can do that ?
Title: Re: Post and PM Inline Attachments
Post by: Arantor on May 08, 2022, 06:14:35 AM
Admin > Maintenance > Server Settings > Disable template eval (tick) > save.

Then observe the new error messages that don't include 'eval?' in the error message and won't be lying about what they are any more...
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 08, 2022, 07:13:55 AM
Quote from: Sebastiii on May 08, 2022, 05:47:13 AMPoint 1)
I'm getting locally and online those errors :

http://127.0.0.1/public_html/forum/index.php?pretty;board=journaux-de-reves;topic=journal-d-emilllie-part2.0
2: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Fichier: C:/wamp64/www/public_html/forum/Themes/default/languages/InlineAttachments.english.php (eval?)
Ligne: 3855

http://127.0.0.1/public_html/forum/index.php?pretty;board=journaux-de-reves.0
2: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Fichier: C:/wamp64/www/public_html/forum/Themes/default/MessageIndex.template.php (eval?)
Ligne: 3855

Each time a page is loaded, I'm getting this many times in a row, so this is a lot of error like you can see.
So there are more than 10000 errors logs.
That looks like a PrettyURLs (https://custom.simplemachines.org/index.php?mod=636) issue to me ...

QuotePoint 2)
Also, I'm using this mod that make conflict : https://custom.simplemachines.org/index.php?mod=3818
An older version, so it seems (1.5 where it's 2.0.3 now)
What is the conflict/issue?

QuotePoint 3)
In Tapatalk, Inline image are ok in post but appear also at the bottom, this means we can see duplicate image in the post from Tapatalk App.
You need to install Tapatalk before this mod so if you've already installed Tapatalk you'll need to uninstall this mod and then reinstall it ...
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 08, 2022, 11:00:32 AM
Quote from: GL700Wing on May 08, 2022, 07:13:55 AMThat looks like a PrettyURLs (https://custom.simplemachines.org/index.php?mod=636) issue to me ...
Maybe, but I don't think so, I will disable it and see if the error is present.
In fact, after disabling the eval settings from @Arantor advice, I'm getting the error about "Custom fields and filters of post" mod, line 3942 :

3922:                    {
3923:                        case 'chart_average':
3924:                        {
3925:                            echo '
3926:        ', $txt['cffp_show_stats_summary_min'], ': ', comma_format($stats['min_num'], $stats['min_num'] == (int) $stats['min_num'] ? 0 : 1), '<br />
3927:        ', $txt['cffp_show_stats_summary_average'], ': ', comma_format($stats['average'], 1), '<br />
3928:        ', $txt['cffp_show_stats_summary_max'], ': ', comma_format($stats['max_num'], $stats['max_num'] == (int) $stats['max_num'] ? 0 : 1), '<br />';
3929:   
3930:                            if (!empty($stats['options_text']) && $stats['chart_average']['options_text'])
3931:                                echo implode('
3932:        <br />', $stats['options_text']), '<br />';
3933:   
3934:                            echo '
3935:        <br />';
3936:                            break;
3937:                        }
3938:                        case 'chart_hbars':
3939:                        case 'chart_vbars':
3940:                        {
3941:                            if ($chart_hvbars)
==>3942:                                continue;
3943:   
3944:                            foreach ($stats['data'] as $value_data)
3945:                                echo '
3946:        ', $value_data['text'], ': ', comma_format($value_data['num']), ' (', comma_format($value_data['percent'], 1), '%)<br />';
3947:   
3948:                            echo '
3949:        <br />';
3950:   
3951:                            $chart_hvbars = true;
3952:                            break;
3953:                        }
3954:                        case 'summary':
3955:                        {
3956:                            foreach ($stats['summary'] as $k => $summary)
3957:                            {
3958:                                if (in_array($k, array('average', 'sum')))
3959:                                    $summary[1] = comma_format($summary[1], 1);
3960:                                elseif ('total' == $k)
3961:                                    $summary[1] = comma_format($summary[1]);
3962:   

https://www.****.com/forum/index.php?action=unread
2: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Fichier: /home/attrapes/public_html/forum/Themes/default/CustomFieldFilterPost.template.php
Ligne: 3942

As we can see, no PrettyURL is involved for "?action" but the mod is enabled.

QuoteWhat is the conflict/issue?
Only on one file in : ".\Themes\default\Printpage.template.php", the installation can't apply change.

QuoteYou need to install Tapatalk before this mod so if you've already installed Tapatalk you'll need to uninstall this mod and then reinstall it ...
Yes, the Tapatalk plugin is already installed and working, with the PPIA installed, it works, but image are duplicate on Tapatalk app.
In the body, message image are placed correctly but are also present at the bottom of the post, so it acts like duplicate images.
Title: Re: Post and PM Inline Attachments
Post by: Arantor on May 08, 2022, 11:06:01 AM
Eval is a technique for catching certain kinds of errors without blowing up the forum - but it makes error logs misleading as you can now see.

That continue; on line 3942 really should be continue 2; as it suggests, and it would be worth telling the mod author about it so he can fix it in future.
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 08, 2022, 11:13:10 AM
@Arantor :)
Thanks again for your help, effectively, changing it to continue 2; and no more error :D
I will post the issue into topic mod for "Custom fields and filters of post" 8)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 08, 2022, 05:56:46 PM
Quote from: Sebastiii on May 08, 2022, 11:00:32 AM
QuoteWhat is the conflict/issue?
Only on one file in : ".\Themes\default\Printpage.template.php", the installation can't apply change.
In this case you need to work out what code change is required and manually apply it - this is simply one of the occasional challenges that occur when installing multiple mods that update the same block of code.

Quote
QuoteYou need to install Tapatalk before this mod so if you've already installed Tapatalk you'll need to uninstall this mod and then reinstall it ...
Yes, the Tapatalk plugin is already installed and working, with the PPIA installed, it works, but image are duplicate on Tapatalk app.
In the body, message image are placed correctly but are also present at the bottom of the post, so it acts like duplicate images.
Ok - if you let me know which version of Tapatalk you're using I'll check the installation code ...
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 09, 2022, 04:08:54 AM
Quote from: GL700Wing on May 08, 2022, 05:56:46 PMIn this case, you need to work out what code change is required and manually apply it - this is simply one of the occasional challenges that occur when installing multiple mods that update the same block of code.
I did try, but I don't succeed, sometimes, I can rule out but here, it removed code that "CustomField" use, so not sure what to do !

QuoteOk - if you let me know which version of Tapatalk you're using, I'll check the installation code ...
Thanks, I'm using the latest for SMF 2.0.19, i.e 4.5.8 :)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 09, 2022, 05:37:01 AM
Quote from: Sebastiii on May 09, 2022, 04:08:54 AMI did try, but I don't succeed, sometimes, I can rule out but here, it removed code that "CustomField" use, so not sure what to do !
OK - I'm working on an update that will (hopefully) support the CustomFieldFilterPost mod ...

QuoteThanks, I'm using the latest for SMF 2.0.19, i.e 4.5.8 :)
I think I have the Tapatalk issue sorted ...

I'll send you a PM when I have a new version ready for you to test  ...
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 09, 2022, 06:17:32 AM
Thanks @GL700Wing ;)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 12, 2022, 06:22:58 PM
Version v7.07 - May 13, 2022
o SMF 2.1: Per FrizzleFried (https://www.simplemachines.org/community/index.php?msg=4122793) - fixed 'Undefined index: attachment' issue when viewing attachments via profile.

o As per Sebastiii (https://www.simplemachines.org/community/index.php?msg=4123564) and Arantor (https://www.simplemachines.org/community/index.php?msg=4123723) - Re-added support for PHP 5.6.

o As per Sebastiii (https://www.simplemachines.org/community/index.php?msg=4123840) - Point 2: Added support for printing with CustomFieldFilterPost mod.

o As per Sebastiii (https://www.simplemachines.org/community/index.php?msg=4123840) - Point 3: Fixed Tapatalk issue where inline attachments are also displayed below the message.

o Re-added support for the 'attachimg' ILA tag for displaying inline attachments that used this particular tag which was only included in some very early versions of the mod.

o Added option to enable suppression of the [ Invalid Attachment ] warning for missing attachments in a message (particularly useful when large numbers of attachments have gone missing from a forum). This doesn't modify the body of the message - just what is displayed when an attachment is missing: which is nothing for a missing attachment if this option is enabled!!

o Added French language support - thanks to Sebastiii (https://www.simplemachines.org/community/index.php?action=profile;u=644678).

o Other minor bug fixes.


Notes
For SMF 2.0 forums using versions 7.04, 7.05 or 7.06 there are upgrade options to version 7.07 - it is not necessary to uninstall 7.04, 7.05, or 7.06 beforehand.

For SMF 2.1 forums using version 7.06 there is an upgrade option to version 7.07 - it is not necessary to uninstall 7.06 beforehand.
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on May 12, 2022, 07:06:42 PM
Thank you @GL700Wing for going WAAAAY beyond the call of duty in helping to get the In Line Attachments to work on my 2.0.x to 2.1.x forum!  I didn't think i'd ever get those early ILA tags to work again...

My users and I appreciate it VERY much!  You rock!
Title: Re: Post and PM Inline Attachments
Post by: Sebastiii on May 12, 2022, 10:31:12 PM
Quote from: FrizzleFried on May 12, 2022, 07:06:42 PMThank you @GL700Wing for going WAAAAY beyond the call of duty in helping to get the In Line Attachments to work on my 2.0.x to 2.1.x forum!  I didn't think i'd ever get those early ILA tags to work again...

My users and I appreciate it VERY much!  You rock!
Yes, I'm totally agreed too @GL700Wing ! You rock !
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on May 25, 2022, 11:30:22 PM
Version v7.08 - May 26, 2022
o Bug fix for 'Undefined index: ila_no_invalid_attachment_warning' error message.


Notes
For SMF 2.0 forums using versions 7.04, 7.05, 7.06 or 7.07 there are upgrade options to version 7.08 - it is not necessary to uninstall version 7.04, 7.05, 7.06 or 7.07 beforehand.

For SMF 2.1 forums using version 7.06 or 7.07 there is an upgrade option to version 7.08 - it is not necessary to uninstall version 7.06 or 7.07 beforehand.
Title: Re: Post and PM Inline Attachments
Post by: Ravey76 on June 03, 2022, 09:20:58 AM
Hello all
maybe someone here can help me:
I have installed SMF version 2.1.2 and would like to insert file attachments/images inline in an article.

When I click on "Insert" for a file attachment/image, the desired image appears within the text in the article preview. However, as soon as I click on "save", the image is no longer displayed inline - it is gone. What could be the reason for this?

Also the option "Embed SVG files within the post?" is deactivated in Admin Area (cannot be selecetd)

Thank you for your support

Karl
Title: Re: Post and PM Inline Attachments
Post by: FrizzleFried on June 03, 2022, 09:57:56 AM
This is the support thread for the INLINE ATTACHMENTS MOD that originated in 2.0.x...

You are going to want to ask your question in the general SMF 2.1.x Support sub-forum... located HERE (https://www.simplemachines.org/community/index.php?board=254.0).
Title: Re: Post and PM Inline Attachments
Post by: Ravey76 on June 03, 2022, 11:30:04 AM
Thank you for pointing this out.
After it didn't work with the original feature, I installed this MOD - but it has the same result.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on June 12, 2023, 04:24:31 AM
v7.09 - June 10, 2023
o SMF 2.0:
  - Performance improvements.
  - Fixed bug introduced in v7.06 that prevented new attachments from being inserted inline when an existing message was modified.
o Note: This version does not support releases of SMF prior to SMF 2.0.14.
o SMF 2.1:
  - Added option to enable/disable mod.
  - If ILA download link and/or counter is configured it will be shown for ALL inline attachments (ie, not just those with BBCode tags originally created by this mod).
  - Added option to suppress warning messages about missing attachments that were originally inserted by this mod: one option hides the warnings if the member cannot edit the message; and the other option hides the warnings even if the member can edit the message.
  - Implemented fix to prevent ILA tags being corrupted by SCEditor (aka 'Quick Edit'). (https://www.simplemachines.org/community/index.php?topic=582543.0)
o SMF 2.0 and SMF 2.1:
  - Mod upgrade option available for v7.07 and v7.08.
  - Language files are now installed in mod specific directory/folder.
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on September 05, 2023, 05:58:24 PM
7.09 does not install in 2.0.19, target code not in source files.  Anyone have 6.18?

That's odd, 6.18 won't install either.  It had been previously installed.


Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 05, 2023, 06:48:28 PM
Quote from: Sir Osis of Liver on September 05, 2023, 05:58:24 PM7.09 does not install in 2.0.19, target code not in source files.  Anyone have 6.18?

That's odd, 6.18 won't install either.  It had been previously installed.
I've just confirmed that v7.09 installs without any errors on a vanilla 2.0.19 forum.

Also, v6.18 is almost three years old and there have been quite a few bug fixes and enhancements in subsequent releases.
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on September 05, 2023, 10:57:41 PM
Hmm, not on my computer but iirc pm was showing a lot of errors, and did not find target code for two edits in Display.php,  Will have another go tomorrow.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 06, 2023, 02:29:14 AM
Quote from: Sir Osis of Liver on September 05, 2023, 10:57:41 PMHmm, not on my computer but iirc pm was showing a lot of errors, and did not find target code for two edits in Display.php,  Will have another go tomorrow.
"pm"??  Is that a reference to the PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974) mod?

If you want to use the following mods together they must be installed in the order shown to ensure there are no installation errors and that they work together properly:
1. PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974)
2. Post and PM Inline Attachments (https://custom.simplemachines.org/mods/index.php?mod=3770)

If you also want to use the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod it must be installed after the Post and PM Inline Attachments (https://custom.simplemachines.org/mods/index.php?mod=3770) mod.


If you later need to uninstall the PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974) mod you must uninstall the Post and PM Inline Attachments (https://custom.simplemachines.org/mods/index.php?mod=3770) mod first.

However, if you have also installed the Automatic Attachment Rotation (and Resize) (https://custom.simplemachines.org/mods/index.php?mod=4087) mod it must be uninstalled before you uninstall the Post and PM Inline Attachments (https://custom.simplemachines.org/mods/index.php?mod=3770) mod.
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on September 06, 2023, 12:31:22 PM
Will try it tonight.  May have had emulation set to 2.1.4 for another mod and forgot to revert, which made it worse.  Just seeing errors now in post template from autorotation mod.  I'll uninstall and install both in correct order.

pm = package manager


What are the 'Test failed (Ignore Errors)'?

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 06, 2023, 06:01:02 PM
Quote from: Sir Osis of Liver on September 06, 2023, 12:31:22 PMWill try it tonight.  May have had emulation set to 2.1.4 for another mod and forgot to revert, which made it worse.
Okay - now I'm confused because in the first post in which you mentioned this issue you referred to 2.0.19 ...

QuoteJust seeing errors now in post template from autorotation mod.  I'll uninstall and install both in correct order.
You must install the ILA mod before the AARR mod.  Also, if you're upgrading from 2.1.3 to 2.1.4 you must uninstall the AARR mod before you apply the update - if you don't do this you will break the forum and end up with a WSOD.

Quotepm = package manager
:P

QuoteWhat are the 'Test failed (Ignore Errors)'?
This mod integrates with several other mods but if one or more of those mods are not already installed this mod cannot/does not make the integration code changes.  If you inspect the code change for the failure in most instances you should see a comment about which mod the code change is for.
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on September 06, 2023, 09:15:34 PM
This is a 2.0.19 forum.  I installed a newer version of Users Online Today, doesn't give me install option unless I emulate 2.1.4.  Surprised it worked, but installed without errors.  Don't know what the mod does, so don't know if it's doing it.  Looks like I'll have to uninstall all the mods (again) and go with clean files.  I had copied NightBreeze theme, which he's been using for couple of years, so he could make a holiday version, mostly with css.  For reasons unknown, display template is different in the two themes.  Don't have a clean copy of the theme, so I have to mess around trying to fix things.

Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 06, 2023, 10:03:44 PM
Quote from: Sir Osis of Liver on September 06, 2023, 09:15:34 PMThis is a 2.0.19 forum.  I installed a newer version of Users Online Today, doesn't give me install option unless I emulate 2.1.4. Surprised it worked, but installed without errors.
Okay - I misunderstood the reference to 2.1.4 ...  I've attached the previous version of the UOT mod which installs and works without any issues on 2.0.19.

QuoteDon't know what the mod does, so don't know if it's doing it.
The mod adds a list of all users that were online on the current day to the 'Info Center'.  Screenshots without and with the mod ...
No-UOT.jpg UOT-1.jpg UOT-2.jpg

QuoteDon't have a clean copy of the theme, so I have to mess around trying to fix things.
The latest version (August 2021) is here (https://custom.simplemachines.org/index.php?theme=2917) and I have a copy of the previous version (September 2020) - let me know if you want a copy of that.
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on September 06, 2023, 10:09:16 PM
Yeah, I had the older version (2.1), installed ok.  Forum is really fussy about order of install, Gallery Pro caused wsod when installed after ILA and AARR.  Had to start over and install gallery first.  Everything is in now, will keep an eye on error log.  Thanks for the help. :)
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on September 06, 2023, 10:15:54 PM
Quote from: Sir Osis of Liver on September 06, 2023, 10:09:16 PMYeah, I had the older version (2.1), installed ok.  Forum is really fussy about order of install, Gallery Pro caused wsod when installed after ILA and AARR.  Had to start over and install gallery first.  Everything is in now, will keep an eye on error log.  Thanks for the help. :)
You're welcome - glad you've got it sorted. 

I put a lot of effort into integration for the mods I maintain/develop (plus others I always use) and it does sometimes mean they need to be installed/uninstalled in a specific order.
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on October 15, 2023, 01:21:27 PM

https://www.simplemachines.org/community/index.php?topic=587131.msg4161651#msg4161651
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 17, 2023, 03:56:58 AM
Quote from: Sir Osis of Liver on October 15, 2023, 01:21:27 PMhttps://www.simplemachines.org/community/index.php?topic=587131.msg4161651#msg4161651
Currently travelling with only limited internet but will look at this when I'm home again next week.
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on October 17, 2023, 04:41:03 PM
Not a big rush, it's on a test forum, not production.  Trying to rerun 2.1 upgrade but having other problems with server.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 22, 2023, 08:17:48 AM
Quote from: Sir Osis of Liver on October 17, 2023, 04:41:03 PMNot a big rush, it's on a test forum, not production.  Trying to rerun 2.1 upgrade but having other problems with server.

Based on the BBCode information you provided (https://www.simplemachines.org/community/index.php?topic=587131.msg4161651#msg4161651) those BBCodes were added using either the In Line Attachments -- ILA (https://custom.simplemachines.org/index.php?mod=2481) mod (which has not been updated since late 2011) or a very early version of the Post and PM Inline Attachments (https://custom.simplemachines.org/index.php?mod=3770) mod (the message number was added to the BBCode in v3.0 of the mod which was released in April 2015).

For missing attachments I can correct the error message to show the actual BBCode in the body of the message and the mod option 'Should first attachment be numbered 1?' can be toggled to display the correct attachment if the numbering is out by one (ie, this option is disabled but the first attachment in a message is numbered '1', or vice versa).

Just a question - in the message you referred to here (https://www.simplemachines.org/community/index.php?topic=587131.msg4161651#msg4161651) are any/all of the attachments shown below the message body?
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on October 22, 2023, 05:04:03 PM
2.1.4 install is running Post and PM Inline Attachments 7.09, 2.0.19 is running 6.3.

2.0.19 - https://www.tradgang.com/tgsmf/index.php?topic=180567.msg3021129#msg3021129
2.1.4 - https://www.tradgang.net/tgsmf/index.php?topic=180567.msg3021129#msg3021129

This is in message body in 2.1 and 2.0 databases -

better versions of ourselves when we're walking with a bow.<br /><br />[attachment=1]<br />[attachment=2]<br />[attachment=3]<br />[attachment=4]<br />

It's the only mod installed in 2.1.4.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 22, 2023, 05:14:57 PM
Quote from: Sir Osis of Liver on October 22, 2023, 05:04:03 PM2.1.4 install is running Post and PM Inline Attachments 7.09, 2.0.19 is running 6.3.

2.0.19 - https://www.tradgang.com/tgsmf/index.php?topic=180567.msg3021129#msg3021129
2.1.4 - https://www.tradgang.net/tgsmf/index.php?topic=180567.msg3021129#msg3021129

This is in message body in 2.1 and 2.0 databases -

better versions of ourselves when we're walking with a bow.<br /><br />[attachment=1]<br />[attachment=2]<br />[attachment=3]<br />[attachment=4]<br />

It's the only mod installed in 2.1.4.

OK - I suspect the association of attachments with their messages has somehow been lost in the SMF 2.1.4 migration.  If you modify the message in SMF 2.1.4 do you see the attachments listed in the attachments window?
Title: Re: Post and PM Inline Attachments
Post by: Sir Osis of Liver on October 22, 2023, 05:37:28 PM
No attachments are shown in post editor, just this in post text -

[attachment=1]
[attachment=2]
[attachment=3]
[attachment=4]

Been trying to import the 2.0 db into the 2.1 forum to rerun upgrade, but it's quite large, they're on different servers, and it won't import.  Host account is a mess, and my access is limited.  It's possible the original upgrade didn't complete successfully, .dat extension was missing from attachment files, had to add it with script.  Maybe try importing it to test install on my server and see if it works.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on October 22, 2023, 06:00:24 PM
Quote from: Sir Osis of Liver on October 22, 2023, 05:37:28 PMNo attachments are shown in post editor, just this in post text -

[attachment=1]
[attachment=2]
[attachment=3]
[attachment=4]
That's what I suspected because on my test SMF 2.1.4 forum messages that use those BBCodes display the attachments inline correctly.

QuoteBeen trying to import the 2.0 db into the 2.1 forum to rerun upgrade, but it's quite large, they're on different servers, and it won't import.  Host account is a mess, and my access is limited.  It's possible the original upgrade didn't complete successfully, .dat extension was missing from attachment files, had to add it with script.  Maybe try importing it to test install on my server and see if it works.
Hope you can get it sorted!
Title: Re: Post and PM Inline Attachments
Post by: digger on November 08, 2023, 09:26:00 AM
Quote from: GL700Wing on June 12, 2023, 04:24:31 AMv7.09 - June 10, 2023
o SMF 2.0:
  - Fixed bug introduced in v7.06 that prevented new attachments from being inserted inline when an existing message was modified.
Can you point which code v7.08 was patched to fix this bug? Version 7.0.9 does not work for me on SMF 2.0.19 - doesn't show inserted attachments, only bbcodes.
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 09, 2023, 04:04:01 AM
Version 7.10 - Nov 09, 2023
o Per digger (https://www.simplemachines.org/community/index.php?msg=4163011) - fixed bug introduced in v7.09 that prevented some attachments from being shown inline.
o Fixed bug introduced in v7.09 that prevented PM attachments from being shown below the PM message body (only relevant if PM Attachments (https://custom.simplemachines.org/mods/index.php?mod=1974) mod is installed).
o Fixed minor 'Print Page' issue that resulted in images also being displayed below the message body even if they were already shown inline.


Note
SMF 2.0 and SMF 2.1 : Upgrade option available for v7.07 onwards.



Quote from: digger on November 08, 2023, 09:26:00 AM
Quote from: GL700Wing on June 12, 2023, 04:24:31 AMv7.09 - June 10, 2023
o SMF 2.0:
  - Fixed bug introduced in v7.06 that prevented new attachments from being inserted inline when an existing message was modified.
Can you point which code v7.08 was patched to fix this bug? Version 7.0.9 does not work for me on SMF 2.0.19 - doesn't show inserted attachments, only bbcodes.
@digger - I just discovered this issue on one of my forums a few days ago for some ILA tags - fixed in v7.10.
Title: Re: Post and PM Inline Attachments
Post by: digger on November 09, 2023, 01:02:06 PM
Quote from: GL700Wing on November 09, 2023, 04:04:01 AMo Per digger (https://www.simplemachines.org/community/index.php?msg=4163011) - fixed bug introduced in v7.09 that prevented some attachments from being shown inline.
This fixed, v7.10 works now.


Quote from: GL700Wing on November 09, 2023, 04:04:01 AMo SMF 2.0:
  - Fixed bug introduced in v7.06 that prevented new attachments from being inserted inline when an existing message was modified.
Still have this bug with v7.10
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 09, 2023, 03:07:17 PM
Version 7.11 - Nov 10, 2023
o Fixed bug introduced in v7.10 that prevented new attachments from being inserted inline when an existing message was modified (bug that was in v7.06 crept back in).


Note
SMF 2.0 and SMF 2.1 : Upgrade option available for v7.07 onwards.




Quote from: digger on November 09, 2023, 01:02:06 PM
Quote from: GL700Wing on November 09, 2023, 04:04:01 AMo SMF 2.0:
  - Fixed bug introduced in v7.06 that prevented new attachments from being inserted inline when an existing message was modified.
Still have this bug with v7.10
Sorry about that - fixed in v7.11.
Title: Re: Post and PM Inline Attachments
Post by: Dave J on November 13, 2023, 05:32:23 AM
Hi GL

I know this might seem like a strange request but is there a way to separate the PM section from the Posts. As you know by default SMF2.1.4 already has the ability to post attachments inline but I would like the option of just the PM attachments.


Don't worry GL for some reason I can't even get the pm attachments to work with this mod on 2.1.4
Title: Re: Post and PM Inline Attachments
Post by: GL700Wing on November 13, 2023, 06:03:31 AM
Quote from: Dave J on November 13, 2023, 05:32:23 AMHi GL

I know this might seem like a strange request but is there a way to separate the PM section from the Posts. As you know by default SMF2.1.4 already has the ability to post attachments inline but I would like the option of just the PM attachments.
For SMF 2.1 this mod still needs to support displaying inline attachment tags that were created by this mod in SMF 2.0 forums that have been upgraded to SMF 2.1.

However, and in relation to this mod only working with PM attachments for SMF 2.1, I'll look into doing what you've asked but I think for SMF 2.1 I'd prefer to just add the functionality to the PM Attachments (https://custom.simplemachines.org/index.php?mod=1974) mod. That said, and as neither of the current mod authors seem to have been active here since mid 2019, I'll have to find out about being added as an author to that mod.
Title: Re: Post and PM Inline Attachments
Post by: Dave J on November 13, 2023, 06:07:06 AM
Quote from: GL700Wing on November 13, 2023, 06:03:31 AM
Quote from: Dave J on November 13, 2023, 05:32:23 AMHi GL

I know this might seem like a strange request but is there a way to separate the PM section from the Posts. As you know by default SMF2.1.4 already has the ability to post attachments inline but I would like the option of just the PM attachments.
For SMF 2.1 this mod still needs to support displaying inline attachment tags that were created by this mod in SMF 2.0 forums that have been upgraded to SMF 2.1.

However, and in relation to this mod only working with PM attachments for SMF 2.1, I'll look into doing what you've asked but I think for SMF 2.1 I'd prefer to just add the functionality to the PM Attachments (https://custom.simplemachines.org/index.php?mod=1974) mod. That said, and as neither of the current mod authors seem to have been active here since mid 2019, I'll have to find out about being added as an author to that mod.

Thanks for the reply GL

My original site used to use the ILA mod which is basically what your mod is replacing so the images all show correctly in 2.1.

When I created my latest site I didn't have a need for post inline attachments but I did want PM attachments

Yes I did ask in the PM Attachments (https://custom.simplemachines.org/index.php?mod=1974) mod topic and as yet no reply. If you are able to fix anyhting that works for PM's that would be great.
Title: Re: Post and PM Inline Attachments
Post by: Dave J on December 13, 2023, 09:57:20 AM
Quote from: GL700Wing on November 13, 2023, 06:03:31 AMHowever, and in relation to this mod only working with PM attachments for SMF 2.1, I'll look into doing what you've asked but I think for SMF 2.1 I'd prefer to just add the functionality to the PM Attachments (https://custom.simplemachines.org/index.php?mod=1974) mod. That said, and as neither of the current mod authors seem to have been active here since mid 2019, I'll have to find out about being added as an author to that mod.

Hi GL did you manage to sort anything out for this?