Post and PM Inline Attachments

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

Previous topic - Next topic

dougiefresh

#260
Quote from: dan4ever on June 30, 2015, 10:53:22 AM
Is it possible to have a movie (.mpg4) as a attachment and to show up like a picture?
Now it show like a downloadlink.
At present time, there is no ability to embed videos attached as attachments.  I will investigate the possibility of embedding attachments as playable videos....

Quote from: dan4ever on June 30, 2015, 11:21:15 AM
Is it possible to use a other name for [attach1]

In swedish it will be [bilaga1]

And some text to the user, so they understand how to use it  (next to the button/area)
I've never heard of a mod allowing its users (admin or otherwise) to change the bbcode tag via the admin UI.  Disabling it, yes.... but not changing it via the admin UI....  Making these changes would make reporting issues to me... um, interesting...  I'm not sure whether doing these changes would be a good idea....  Anyone have input on this?

yakyakyak

Quote from: njtweb on June 30, 2015, 07:57:47 AM
Hmm....seems like this mod has some issues. I don't get errors, instead everything the mod is supposed to do is ignored like it's not even installed.

It should be suspended as it doesnt do what it says on the box.

CrescentEclipse

I hope not! I really need this mod, because this is the ONLY mod which compensates the lack of an inbuilt functionality to embed pictures in your posts from your own webspace through the UI! It's a real shame that SMF does not provide such a natural feature.

dougiefresh

Quote from: njtweb on June 27, 2015, 11:39:36 AM
Hi trying this out today.

after install these are the settings I selected.
Remove attachment image under post after in-post use? --->Checked
Show download link and counter under inline attachment? --->UnChecked
Turns "nosniff" option off? --->UnChecked
Should first attachment should be numbered "1"? --->UnChecked
"attach" bbcode same as "attachment"? --->Checked
Allow quoted attachment images from another post? --->Checked

I added the bbcode [attachment id=0][/attachment] to the top of my story. here http://minorleaguelegends.com/board/player-related-news-stories/report-former-nhl-player-burnett-in-coma/msg102/#msg102

However, it doesn't show up at the beginning of the story as it should. And it's still showing up at the bottom of the story with a download link.

Any help is greatly appreciated. Thank you in advance.
I can duplicate the issue you reported.  Let me see what I can do about this issue....

margarett

Quote from: dougiefresh on June 30, 2015, 03:48:15 PM
I've never heard of a mod allowing its users (admin or otherwise) to change the bbcode tag via the admin UI.
(...)
I'm not sure whether doing these changes would be a good idea....  Anyone have input on this?
I confirm this. I also don't know any software that allows to change any code-related part via UI.
IMO that's not a good idea (and, TBH, I'm not even sure if our BBC parser allows the processing of variable-named tags - and I would guess it won't)

Quote from: yakyakyak on June 30, 2015, 04:00:27 PM
(...)
When one has nothing interesting to say, silence is a great option ;) Please use it more often...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

dougiefresh

#265
Quote from: margarett on June 30, 2015, 06:20:53 PM
I confirm this. I also don't know any software that allows to change any code-related part via UI.
Thanks for confirming this, margarett!

Quote from: margarett on June 30, 2015, 06:20:53 PM
IMO that's not a good idea (and, TBH, I'm not even sure if our BBC parser allows the processing of variable-named tags - and I would guess it won't)
Frankly, IMHO, implementing such a feature seems like a REALLY bad idea.... 

As a hypothetical problem solving exercise, it wouldn't be that difficult to do, as the tag itself is inserted by the source file and could be pulled from the $modSettings array.  For example, the bbcode definition hook could be done like this:
function BBCode_VNT(&$bbc)
{
global $modSettings;
$bbc[] = array(
'tag' => (isset($modSettings['variable_named_tag']) ? $modSettings['variable_named_tag'] : 'variable_named'),
'type' => 'unparsed_content',
'content' => '$1',
'disabled_content' => '$1',
);
}

But changing the tag by way of the admin UI would break ALL usages of the old tag unless other measures (such as a global find/replace) were implemented, all of which would consume major resources during the find/replace operation.... 

Quote from: margarett on June 30, 2015, 06:20:53 PM
Quote from: yakyakyak on June 30, 2015, 04:00:27 PM
(...)
When one has nothing interesting to say, silence is a great option ;) Please use it more often...
Thanks for saying what I couldn't figure out how to say nicely....  :P

Quote from: njtweb on June 27, 2015, 11:39:36 AM
I added the bbcode [attachment id=0][/attachment] to the top of my story. here http://minorleaguelegends.com/board/player-related-news-stories/report-former-nhl-player-burnett-in-coma/msg102/#msg102

However, it doesn't show up at the beginning of the story as it should. And it's still showing up at the bottom of the story with a download link.
I copied your referenced post onto my localhost forum and installed the mod there.  It seems that the ENTIRE problem is the mod's ability to add the message ID to the inline attachment tag when it is referenced between quotes....  I added a switch to disable that functionality so that the picture does show up where it is placed within the quote.  As soon as I figure out what is going on with the rest of the bug reports, I'll post the next version of the mod!

EDIT: What happens is when the inline attachment is placed between the quote tags, the mod attempts to modify the inline attachment tag so that the attachment is pulled from the quoted message instead of the current message.  When no message is referenced in the quote, it has no option but to strip out the inline attachments from that quoted message because it doesn't know what message to pull it from.  The code modification I did adds a switch to disable the described quote modification code....  Hope this helps you to understand what was going on....

Quote from: dan4ever on June 30, 2015, 10:53:22 AM
Is it possible to have a movie (.mpg4) as a attachment and to show up like a picture?
Now it show like a downloadlink.
I'll implement a bbcode tag for playing attached mp4 files within this mod....  Shouldn't be too hard to do.

njtweb

Quote from: dougiefresh on June 30, 2015, 06:03:22 PM
Quote from: njtweb on June 27, 2015, 11:39:36 AM
Hi trying this out today.

after install these are the settings I selected.
Remove attachment image under post after in-post use? --->Checked
Show download link and counter under inline attachment? --->UnChecked
Turns "nosniff" option off? --->UnChecked
Should first attachment should be numbered "1"? --->UnChecked
"attach" bbcode same as "attachment"? --->Checked
Allow quoted attachment images from another post? --->Checked

I added the bbcode [attachment id=0][/attachment] to the top of my story. here http://minorleaguelegends.com/board/player-related-news-stories/report-former-nhl-player-burnett-in-coma/msg102/#msg102

However, it doesn't show up at the beginning of the story as it should. And it's still showing up at the bottom of the story with a download link.

Any help is greatly appreciated. Thank you in advance.
I can duplicate the issue you reported.  Let me see what I can do about this issue....

I saw you registered to test. Lemme know if you have any questions or need me to do anything. I really need to use this, and I'll be happy to donate to you, if you accept them.

dougiefresh

#267
@njtweb and @CrescentEclipse: I noticed that both of you are using the WYSIWYG mode of the SMF editor.  I can confirm that this mod DOES NOT properly work with the SMF's WYSIWYG mode.  The attachment tags were removed from the message when I switched between modes.  I can also confirm that the ILA link beside the attachment upload box doesn't work in WYSIWYG mode.... I'm not sure how to fix this issue, but I am going to investigate this issue further....

I've attached a new copy of Subs-InlineAttachments.php to this post.  Can either (or both) of you replace the copy you have and report whether it solves ANY of your problems?  Note that it won't solve the WYSIWYG problem, as that's more a template issue than a source file issue...  Thanks in advance....

Quote from: yakyakyak on June 30, 2015, 04:00:27 PM
It should be suspended as it doesnt do what it says on the box.
I don't remember packaging it in a box.  I put it in a ZIP file.  If you got my mod in a box, GET YOUR MONEY BACK!!!  :P

njtweb

Hi @Dougiefresh, I replaced with the new subs file and no change. The bbcode disappears once I re-save.

What do you mean "With the WYSIWYG" problem?

dougiefresh

Quote from: njtweb on July 01, 2015, 03:29:52 PM
Hi @Dougiefresh, do I uninstall the existing and reinstall with the new?
No, just upload the new file to your forum's Sources folder.  You may want to rename the original file, in the event that you encounter problems or want to revert back to the version 3.7 copy of the file.  There SHOULDN'T be any functionality issues with the new file, as I've tested it before attaching it to the post....

Quote from: njtweb on July 01, 2015, 03:29:52 PM
What do you mean "With the WYSIWYG" problem?
I've edited the post a few times  :P ::)  Lemme quote:
Quote from: dougiefresh on July 01, 2015, 03:22:27 PM
@njtweb and @CrescentEclipse: I noticed that both of you are using the WYSIWYG mode of the SMF editor.  I can confirm that this mod DOES NOT properly work with the SMF's WYSIWYG mode.  The attachment tags were removed from the message when I switched between modes.  I can also confirm that the ILA link beside the attachment upload box doesn't work in WYSIWYG mode.... I'm not sure how to fix this issue, but I am going to investigate this issue further....

dougiefresh

Quote from: njtweb on July 01, 2015, 03:29:52 PM
Hi @Dougiefresh, I replaced with the new subs file and no change. The bbcode disappears once I re-save.
Huh.... Disappointing.  Did you check the new option in the admin panel, by any chance?  (Sorry, forgot to mention that there was one...)

Quote from: njtweb on July 01, 2015, 03:29:52 PM
What do you mean "With the WYSIWYG" problem?
"With the WYSIWYG problem" means that probably no amount of changes in the files in the Sources folder will fix this issue.  Changes to the templates (Themes\default folder) will be required in order to solve this problem....  At this moment, the best "solution" is to disable WYSIWYG mode within SMF....  :-[

RSI

Quote from: CrescentEclipse on June 30, 2015, 05:25:07 PM
because this is the ONLY mod which compensates the lack of an inbuilt functionality to embed pictures in your posts from your own webspace through the UI! It's a real shame that SMF does not provide such a natural feature.

People have been trying to tell the SMF team that for a long time and for some reason it always leads to arguments. They should make it a built in feature to where it allows you to insert images/attachments in-line. Then others could just come up with the mods for Highslide and other similar pop-up and manipulation add-on features. As long as the base feature was already there.

njtweb

Here's what I have in admin. There's an empty check box.


dougiefresh

Check that last box without a description beside it.  That's the "Don't add message ID to quoted inline attachment?" setting.

What mods do you have installed?  It might be helpful to know this....

njtweb

Ok, I clicked the checkbox and tried the attachment BBCode again. No go


1.   Post and PM Inline Attachments   3.7   [ Uninstall ]
2.   Linked Words   1.0   [ Uninstall ]
3.   Footer Menu v.1   v.1   [ Uninstall ]
4.   RIAST: Remove Index & Add Smart Title   1.3.0   [ Uninstall ]
5.   EzPortal   3.0.3a   [ Uninstall ]
6.   Similar Topics   0.6   [ Uninstall ]
7.   More Spiders   1.2   [ Uninstall ]
8.   Google Translate for SMF 2.0   1.4   [ Uninstall ]
9.   Users mass actions   0.1.1   [ Uninstall ]
10.   Add Table, Td, Tr Button   1.0   [ Uninstall ]
11.   SRAVC - Separate Replies And Views Column   1.9.4   [ Uninstall ]
12.   Views and Replies + Table on Recent Posts   1.2.1   [ Uninstall ]
13.   Child Board Hover   1.0   [ Uninstall ]
14.   MessagePreviewOnHover   1.8   [ Uninstall ]
15.   Enhanced PM Popup   1.0.1   [ Uninstall ]
16.   Tidy Child Boards   1.4.1   [ Uninstall ]
17.   SA Twitter   1.2   [ Uninstall ]
18.   SA Facebook   2.0.5   [ Uninstall ]
19.   Show BBCode to guests   0.1.7   [ Uninstall ]
20.   SEO Sitemap   2.2.1   [ Uninstall ]
21.   Float BBCODE   1.0.2   [ Uninstall ]
22.   MicroData SEO Linktree   1.0   [ Uninstall ]
23.   Responsive Curve   1.0 Beta 5   [ Uninstall ]
24.   Bot Buster   1.1   [ Uninstall ]
25.   Anti Bot: Are You Human/Bot?   3.0   [ Uninstall ]
26.   Invitation Message In Your Face (IMIYF)   0.3.2   [ Uninstall ]
27.   Socialize   1.8   [ Uninstall ]
28.   Menu Buttons   1.1   [ Uninstall ]
29.   SMFConnect   1.0   [ Uninstall ]
30.   Add Favicon.ico Support   1.101   [ Uninstall ]
31.   SimpleAds   1.0.1   [ Uninstall ]
32.   New Topic Button   1.0   [ Uninstall ]
33.   Yet Another YouTube BBCode Tag   2.5   [ Uninstall ]
34.   Tagging System   3.0   [ Uninstall ]
35.   SMF Trader System   1.7   [ Uninstall ]
36.   Show JDALLAUI in Post and PM   1.2   [ Uninstall ]
37.   reCAPTCHA for SMF   1.0.0   [ Uninstall ]
38.   Profile Comments   2.2   [ Uninstall ]
39.   Pretty URLs   1.1.2   [ Uninstall ]
40.   NHL Video BBCode   1.0   [ Uninstall ]
41.   Align submit buttons in posts   1.0.4   [ Uninstall ]
42.   Say Thanks   1.3.3

CrescentEclipse

Only the Mod "Resize Attached Images 2.4.1" and your mod. Nothing else.

njtweb

Thats all you have and this mod doesn't work for you?

CrescentEclipse

Exactly. I only want a solution to allow users to upload pictures and save them the trouble to resize their content before upload. This does th first mod. I also want the feature to use the uploded content in posts. Therefore the second mod. That's it ;)

CrescentEclipse

Hm, it looks like the most issues are indeed related to the WYSIWYG editor. I disabled this option and now it seems to work better. I do not get the messed up attachment bbcodes, missing bbcodes or error messages anymore.

The only problems left are

  • The misleading error message in preview mode [ You are not allowed to view attachments ]
  • The message [ Invalid Attachment ] in quotes (with id) when the option "Allow quoted attachment images from another post?" is disabled (I think the mod should just be quiet here to not confuse the user too much)
  • When the option "Display image attachments as pictures under post" is disabled, the mod does not work (inline attachments are not displayed). This option seems essential to the mod, but does not allow the admin to only show download links under posts while showing inline attachments as images in posts! Makes no sense to me. Therefore I must use thumbnails to not waste screen space in the attachment section.
  • I cannot use the advanced version 2.0 bbcodes. While the format [attachment={id},{width}][/attachment] works, e.g. the formats [attachment= id={id} width={width}][/attachment] and [attachment= id={id} width={width} float={float}][/attachment] do not. They only show plain text in the message. Sometimes the tag "id" gets changed to "1d". Strange...

njtweb

Ok, I disabled WYSIWYG editor as well and I too have [you are not allowed to view attachments] now. While perms for all users are set to 'yes' to view attachments, (or checked)

Advertisement: