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

allkary

Hello, I get some warnings when installing the mod and when attaching the fails it says "[ Invalid Attachment ] "
Thanks for your time :)

dougiefresh

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!

saurabh1938

#22
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
Visit my forum : www.gotripperz.com

dougiefresh

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

dougiefresh

Uploaded v1.4 - August 23th, 2014
o Fixed multiple issues in the inline attachment validation function.

marcosdjcm

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:




dougiefresh

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.

dougiefresh

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.

saurabh1938

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
Visit my forum : www.gotripperz.com

dougiefresh

If you tell me what mods you are running, I might be able to track down your incompatibility....

saurabh1938

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
Visit my forum : www.gotripperz.com

dougiefresh

@saurabh1938: Can you at least tell me what inline attachment mod you are using now?  Maybe I can learn something from it......

saurabh1938

I am using this ILA Mod...  it's not listed on this site

https://github.com/Spuds/SMF-ILA
Visit my forum : www.gotripperz.com

thelastlokean

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.

dougiefresh

Uploaded v1.5 - December 6th, 2014
o Fixed attachments not being hidden after use in post with Custom View of Attachments installed.

@thelastlokean: I'm sorry for the late response.  I'll start looking into the issues reported in this thread.....

dougiefresh

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

dougiefresh

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.
o Added support for JQLightBox.




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

Arantor

Seriously... SMF's editor doesn't even handle all its OWN bbcode properly, and good luck adding more to it...

dougiefresh

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

dougiefresh

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.

Advertisement: