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

RSI

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.

dougiefresh

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.

RSI

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.

dougiefresh

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

RSI

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.

Stanyy

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.

dougiefresh

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

RSI

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

RSI

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

RSI

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

dougiefresh

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

RSI

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?

RSI

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.

dougiefresh

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

RSI

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

dougiefresh

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

RSI

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.

RSI

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

Motorhed

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

dougiefresh

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

Advertisement: