News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Post and PM Inline Attachments

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

Previous topic - Next topic

adamtwar

Ps. But other than that, your mod works great, also in combination with Highslide. Thanks! :)

dougiefresh

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.

dougiefresh

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

brynn

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.

dougiefresh

I can confirm this bug report. Let me look into it....

dougiefresh

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

brynn

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

dougiefresh

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)

CrescentEclipse

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 ;)

brynn

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  :)

dougiefresh

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

CrescentEclipse

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?

dougiefresh

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

dougiefresh

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

dougiefresh

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

brynn

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)   :)

keyboard

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
Слaва
Украинi

brynn

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

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  :))

dan4ever

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
/Dan Olsson, Webmaster at https://www.guldforum.se

Advertisement: