News:

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

Main Menu

Post and PM Inline Attachments

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

Previous topic - Next topic

roshaoar

Yep, superb, that does it. Thanks!

dougiefresh

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....

josx2

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]"

josx2

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

dougiefresh

@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....

RSI

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...

dougiefresh

Uploaded v3.4 - April 14th, 2015
o Fixed topic display issue when using Recent Forum Topics Boardindex 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.

roshaoar

Fab, you're a gent. I'll install this over the w/e

Thanks again

-Johan

RSI

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

josx2

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 [nofollow]
File: /home/me/public_html/Themes/default/Display.template.php
Line: 499
just fyi that i'm not getting that error

RSI

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.

josx2

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

RSI

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.

josx2

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)

dougiefresh

#214
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....

dougiefresh

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!!

josx2

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! 

RSI

#217
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

dougiefresh

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....

RSI

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.

Advertisement: