News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Post and PM Inline Attachments

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

Previous topic - Next topic

Yahmez

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.

brynn

Does 4.6 have the fix for the error I reported?  (the error that only came from 1 topic)

dougiefresh

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.

asmith

#423
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)

brynn

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:

dougiefresh

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.

asmith

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.

dougiefresh

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.  Any chance you might send me the contents of that post, either publicly or via PM?  Thanks!

dougiefresh

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

brynn

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?

debiwebi

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

Some mornings it just isn't worth
chewing through the leather straps.
~Emo

Unlimited Own Posts Editing Time

asmith

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)

debiwebi

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.
Some mornings it just isn't worth
chewing through the leather straps.
~Emo

Unlimited Own Posts Editing Time

dougiefresh

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.

asmith

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

brynn

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

dougiefresh

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

BellGab.com

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.

brynn

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.

hannes_kann_es

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?

Advertisement: