ElkArte Community

Extending Elk => Addons => Topic started by: Spuds on May 23, 2014, 10:09:38 pm

Title: [ADDON][WIP] In Line Attachments
Post by: Spuds on May 23, 2014, 10:09:38 pm
Another WIP addon, 

*** Note *** this is now built into ElkArte 1.1.x

This one is my conversion of ILA, in line attachments.  Right now all the hooks are in place so the ILA tags render, placing the image in line with the text.  Whats missing is the easy tag placement in the editor, so for now you have to add an attachment as normal, and then in the text, enter the ILA tag where you want the image to display. 

I'm not sure what direction I may take with the editor, so for now .....

In Line Attachments v1.0


License
This addon is released under a MPL V1.1 license, a copy of it with its provisions is included with the package.

Introduction
This addon adds the ability to position your attachments in your post, like the IMG tag, using newly created BBC codes. This is useful for inserting attachments inline with your text.  Several types of attachments are possible such as : full-size, thumbnail or link. For each attachment you can select how and where the attachment appears within the message. You can also use the same image in multiple areas in the same post. You can of course still have the attachment at the bottom of the post as is the ElkArte default.

Features

There are some basic admin settings available with this mod, go to admin - configuration - addon settings - ILA.  Here you can disable/enable the addon.
Title: Re: [ADDON]{WIP} In Line Attachments
Post by: emanuele on May 24, 2014, 03:40:32 am
/me smells good stuff here!
Title: Re: [ADDON][WIP] In Line Attachments
Post by: meetdilip on September 07, 2014, 11:46:28 pm
What is the status of this add on ?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: CrimeS on September 08, 2014, 04:11:39 am
I think that this add on should be integrated into ElkArte :)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on September 08, 2014, 08:24:36 am
It is currently lacking the posting interface, so right now you have to manually add the [attach] bbc codes.  I have to spend some time on figuring out a decent interface to insert the codes.

Quote from: CrimeS – I think that this add on should be integrated into ElkArte :)
There was talk about doing that for 1.0 (very early on), you may see it in 1.1, depends on getting the UI and some more testing, there are quite a few unusual conditions that it has to handle !

Title: Re: [ADDON][WIP] In Line Attachments
Post by: overscan on October 02, 2014, 05:34:01 am
Tried it on my new Elkarte test install, but I get a parse error on testing:

Extract File   ./themes/default/css/ILA.css   Modification parse error

This is on a vanillaElkarte install. Any ideas?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on October 02, 2014, 05:44:20 am
Because Spuds is testing on windows where ILA.css and ila.css are the same file, while on *nix is not. :P
Title: Re: [ADDON][WIP] In Line Attachments
Post by: overscan on October 02, 2014, 05:54:32 am
damn Windows users  :D

I earn my living now as a Senior Wintel engineer but started out on Amigas and Solaris back in Windows 3 era.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on October 02, 2014, 04:38:14 pm
Quote from: emanuele – Because Spuds is testing on windows where ILA.css and ila.css are the same file, while on *nix is not. :P
Doh .,.. what he is saying is sometimes I'm about as sharp as a bowling bowl !  I've only made that same error like 1000 times !
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on October 02, 2014, 04:54:18 pm
/me uses linux not to do these errors, but can do much more funny ones! :P
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on November 01, 2014, 10:31:05 am
https://bitbucket.org/spuds_/elk_ila

one of my favourite addon, is working with ELK 1.0.0 ;)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on November 02, 2014, 07:45:34 am
Glad its working for you :D ... I still need to add a post screen interface, I'm just still undecided what I want to do for that,
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on November 02, 2014, 08:21:06 am
I sow that I have to insert manually the bbcode for inline images, but for now is enough, I am using your SMF mod on my forum and if I'll convert to Elk I wont loose the inline images ;) (the pagination I mean, not the attachments).

And it also works with Fancybox, another addon that I like (less features than HS4smf but still a great one)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on November 06, 2014, 06:31:38 am
There is a problem with this mod and simple portal. I don't kow if is related to SP or ILA.

I have a block "Board news" where I insert the images inline floatet to left. In smf is working fine, but not on Elk. I attach 2 images to explain better

p.s. I can also provide an account if someone want to take a look.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on November 06, 2014, 09:49:01 am
Looks like its not finding the image. to display?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on November 06, 2014, 10:09:53 am
but it topic view I can see the image:

Code: [Select]
skodaclub.it/skodaelk10/
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on November 06, 2014, 10:57:41 am
Now I remember that bug from SMF days, its due to the $topic not being set when coming in from a portal page.  If you look at the links on those images they say topic=0.0  I'll get that fixed in a bit.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on November 16, 2014, 06:44:19 pm
sorry if I insist, but was this solved? thank you in advance
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on November 16, 2014, 07:48:25 pm
Not resolved but not forgotten either ... will get it fixed soon, I promise !
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on November 17, 2014, 06:18:37 pm
Please replace your ILA.subs.php with this one and let me know if it resolves the issue.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on November 17, 2014, 07:10:39 pm
yes, the inline images are showed correctly on portal  ;D

there is another problem with the titles:
Code: [Select]
skodaclub.it/skodaelk10/index.php 
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on November 17, 2014, 08:07:09 pm
Thats the floats acting up ... you can try adding

Code: [Select]
.sp_article_content .righttext {
clear: both;
}

to portal.css ... after the .sp_article_content selector.  May be a better way but that should work.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on November 17, 2014, 08:28:59 pm
that worked, thanks!
Title: Re: [ADDON][WIP] In Line Attachments
Post by: b4pjoe on November 24, 2014, 11:53:02 am
In the admin settings...what does "(ILA) Only show basic ILA menu" do?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on November 24, 2014, 12:05:13 pm
Quote from: b4pjoe – In the admin settings...what does "(ILA) Only show basic ILA menu" do?
for now nothing, in the old version for SMF it was showing a dropdown menu from where you could set the position. Once set the position the mod adds the bbcode. For now ILA for  elkarte is WIP (work in progress) and you should write the bbcodes manually.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: b4pjoe on November 24, 2014, 12:07:11 pm
Thanks for the info. I thought maybe I was supposed to be seeing something when I checked it...but I wasn't. :)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on January 02, 2015, 05:43:34 pm
In these days I keep an eye on my error log and I found something regarding the ILA addon: when a user insert a .pdf attacchment and use the code  [attachurl=1] I get thison my error log:

Tipo di errore: Generale
Too few arguments: URL   http://www.skodaclub.it/index.php?topic=2388.0
File: /....***/sources/subs/ILA.subs.php
Riga: 56

---edit---
I know this addon is wip, but in the future would be nice to have responsive images inserted with  [attachimg=x]
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on January 07, 2015, 08:51:50 am
Spuds: in the perspective to bring this into the code (at some point :P), what would you think if the attachments are created exactly the moment they are uploaded and passed the tests? Without waiting for the message to be posted?
Thinking quickly about it I would see as pro:
* [attach=1] could become [attach=123] where 123 is the attachment id (that should save some hassles),
it would allow to simplify the code related to handling attachments in session during posting (we could just store the attach id),
probably something else
In the con list I would add:
less "easy" to remove them when not used (well, not exactly but it would be slightly difficult to identify them)
the id attach could growth slightly faster.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on January 07, 2015, 10:08:30 am
Quote from: emanuele – in the perspective to bring this into the code (at some point :P),
into the core, right? ;) I like the idea, I imagine this will not happen before 1.1 release
Quote from: emanuele –
* [attach=1] could become [attach=123] where 123 is the attachment id
I don't know if this is so good, because you also have to find a solution to convert the existing inline attachments for those who are using this addon. Some softwares like XF are using inline attachments into core and they are using the same bbcodes as elkarte attach=x and attachimg=x (where x is not the attachment id, but the id of attachment into that post) so you will have to do some extra work on open importer.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on January 07, 2015, 07:48:33 pm
Thanks for the bug report, I'll take a look. {eta line 56? could you post your subs file, in mine thats a comment line)

RE core ... yeah we have to think about this some for sure, they way it works now is complicated having to do the translation from post ID to real ID.  But then there are complications when you go to edit, so you would have to turn it around so it made sense to the poster (meaning =1 or maybe =attachment name) vs =123873 ... 

Actually I think its the quote checking that is the most complicated anyway, when I did the mod there was one user who really beat the heck out of it and found all sorts of cool usage cases that I had to work around.

I have not looked at that code since I posted the WIP  O:-) I really should !!
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on February 07, 2015, 06:44:45 am
Quote from: radu81 – I know this addon is wip, but in the future would be nice to have responsive images inserted with  [attachimg=x]
Please remember about this, maybe is just a simple trick with css, but I don't know how to solve it
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on February 07, 2015, 11:15:32 am
I posted the original in the wrong topic... sorry.


A similar approach to the one for normal images would be to edit ILA.subs.php this way:
Code: (find) [Select]
							<img src="' . $this->_attachment['href'] . ';image" alt="' . $uniqueID . '" title="' . $ila_title . '" id="thumb_' . $uniqueID . '" style="width:' . $this->_curr_tag['width'] . 'px;" />
</a>';
else
$inlinedtext = '<img src="' . $this->_attachment['href'] . ';image" alt="" title="' . $ila_title . '" id="thumb_' . $uniqueID . '" style="width:' . $this->_curr_tag['width'] . 'px;" />';
Code: (replace with) [Select]
							<img class="bbc_image resize" src="' . $this->_attachment['href'] . ';image" alt="' . $uniqueID . '" title="' . $ila_title . '" id="thumb_' . $uniqueID . '" />
</a>';
else
$inlinedtext = '<img class="bbc_image resize" src="' . $this->_attachment['href'] . ';image" alt="" title="' . $ila_title . '" id="thumb_' . $uniqueID . '" />';

TBH I'm not sure about the name of the classes amd I can't find a bbc image at the moment sorry.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on February 07, 2015, 02:25:15 pm
I tried but the imge goes out of the forum layout. That code ignore the width tag
ex:
Code: [Select]
[attachimg=1 width=800]
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on February 07, 2015, 02:41:18 pm
:-[

Looks like I have to better study the code... sorry.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on February 07, 2015, 05:10:19 pm
Quote from: emanuele – :-[

Looks like I have to better study the code... sorry.
/me too !
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on April 19, 2015, 06:04:31 am
I'm having a little problem with this addon, yesterday I was watching my drafts and I sow 15 pages of drafts, I tried to go to next page of drafts but an error showed. In elkarte error log I see:
Code: [Select]
 Tipo di errore: Critico
Wrong value type sent to the database. Integer expected. (msg)
Function: _ila_get_topic  URL http://www.skodaclub.it/index.php?action=profile;area=showdrafts;u=1
File: /../../skodaclub.it/sources/subs/ILA.subs.php
Riga: 729
I tried to delete my drafts, but I was not able.

Now I cannot see my drafts, when I go in drafts I see Wrong value type sent to the database. Integer expected. (msg)
In error log I got the same error above. How could I solve this?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on April 20, 2015, 07:58:06 am
I'll take a look at this today ... sorry for the delay !
Title: Re: [ADDON][WIP] In Line Attachments
Post by: gevv on May 25, 2015, 05:29:52 pm
hi,
there is a problem
do not add adds new bbcodes

I tested  wamp server and active host
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on May 25, 2015, 05:51:48 pm
Quote from: Spuds – Another WIP addon,
Whats missing is the easy tag placement in the editor, so for now you have to add an attachment as normal, and then in the text, enter the ILA tag where you want the image to display. 

I'm not sure what direction I may take with the editor, so for now .....
Title: Re: [ADDON][WIP] In Line Attachments
Post by: gevv on May 26, 2015, 10:43:49 am
Hi,

I'm sorry I got it wrong.

the fact that the example in the picture 

I would hope that in the new version :)

(sorry my english very bad)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on May 26, 2015, 11:07:37 am
Good suggestion ... was thinking along those lines as well. 
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on July 31, 2015, 04:23:33 am
With @Spuds blessing I started looking at integrate this into 1.1 and the current step in terms of code is here: https://github.com/emanuele45/Dialogo/tree/ila
While attached to this topic an example of the current result. O:-)
Clicking the icon the tag is automagically inserted into the editor.

There are a couple of potential issues here and there (still), but hopefully before 1.1 final is released will be fixed! ;D

ETA: one of those issues is that I don't like the icon I picked. LOL
Any fontawesome suggestion would be awesome! :D
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on July 31, 2015, 05:57:28 am
That is a great news! I love the idea. Most forums have this into core, even Kunena ;)

If could be useful a screenshot from XF:
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on July 31, 2015, 09:28:11 am
Looking good :D ...

RE the icon ... maybe the anchor or the file-image-o ?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on July 31, 2015, 12:02:47 pm
For the moment I unified the "uploaded attachments" and the "newly uploaded" interfaces, so that now all are show the same way! Having just one interface it becomes easier to deal with changes. O:-)

Have a look at XF interface is handy for sure! :D
What I think we should do is (even though we are going a little OT but I hope Spuds will not kick us from the topic... O:-)):
1) drop the 100% progressbar, when the file is uploaded is a bit useless;
2) add the thumbnail;
3) I was using icons to avoid words for consistency (and because it's usually easier for translation, theming and coding :P), but maybe words are the best option?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on July 31, 2015, 04:24:41 pm
Little example of the current state. :D
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Flavio93Zena on July 31, 2015, 05:17:38 pm
Wow coolio :D
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on August 07, 2015, 09:56:06 am
today a member sent me a PM with a critical error. He told me that he got that error when looking into drafts. I have no other information, in the error log I got:
Code: [Select]
 7630ef95227de92c28f925fa7de35e28
 Tipo di errore: Critico
Wrong value type sent to the database. Integer expected. (msg)
Function: _ila_get_topic  URL http://www.skodaclub.it/index.php?action=profile;area=showdrafts;u=511
File: /../sources/subs/ILA.subs.php
Raw: 729

I checked my drafts but I was not able to reproduce this error. Anyone else with this error?
In the error log, in the last week I only see 8 of this errors, but all are from the same user.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on August 07, 2015, 10:11:42 am
That would be a bug with inline attachments ...

I'd say they saved a draft using the ILA tags which the system is trying to fulfill one way or another.  I should be able to reproduce this and come up with a fix this weekend. 
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on August 25, 2015, 05:18:22 am
Quote from: radu81 –
Quote from: radu81 – I know this addon is wip, but in the future would be nice to have responsive images inserted with  [attachimg=x]
Please remember about this, maybe is just a simple trick with css, but I don't know how to solve it
Please don't forget about this  :D
you can see it here: skodaclub.it/index.php?topic=1683
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Flavio93Zena on August 25, 2015, 05:52:41 am
Yeah it's a missing max-width: 100% on images.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on August 26, 2015, 03:28:55 am
I don't know if it's a good solution but I solved the problem with responsive images inserted with [ attachimg=x ] by changing the line 531 in ILA.subs.php  from
Code: [Select]
$inlinedtext = '<img src="' . $this->_attachment['href'] . ';image" alt="" title="' . $ila_title . '" id="thumb_' . $uniqueID . '" style="width:' . $this->_curr_tag['width'] . 'px;" />';
to
Code: [Select]
$inlinedtext = '<img src="' . $this->_attachment['href'] . ';image" alt="" title="' . $ila_title . '" id="thumb_' . $uniqueID . '" style="max-width: 100%;" />';
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Flavio93Zena on August 26, 2015, 03:39:50 am
I think it should work, I don't know if @Spuds has other coding standards or something, but it works and it's responsive regardless of the selected theme :)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on August 26, 2015, 03:47:32 am
for me is working ;)
Quote from: radu81 – you can see it here: skodaclub.it/index.php?topic=1683
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Flavio93Zena on August 26, 2015, 04:44:06 am
I know it does, because I had tried it :P
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on August 27, 2015, 08:40:06 am
Tracked for 1.1 https://github.com/elkarte/Elkarte/issues/2191

ETA: just to explain why "1.1 beta 2", I set it as "blocker", so no release until it's fixed, but is a little tweak, so if it is fixed for beta 1 good, otherwise it must be fixed for beta 2. :)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: wintstar on August 27, 2015, 08:56:51 am
I also found error for "1.1 beta 2" => https://github.com/elkarte/Elkarte/issues/2189.

Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on August 27, 2015, 09:29:40 am
if this addon it will be in the core maybe you have to revisit openimporter and/or ILA, because most forums had inline attachements into core and most of them are using the same bbcode [attach=x) or [attachimg=x) where x is the id of attachment in the forum, not in topic. ILA is not using the id of the attachment in the whole forum, but the id of attachment in that topic. With the first solution you can embed an attachment inline in different topics.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on August 27, 2015, 05:29:35 pm
There could be a "compatibility mode", where the id is the attachment id instead of the message id?
Or the other way around: change ILA code to use the attachment id and have a compatibility-mode that uses the message attachment id?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on February 10, 2016, 03:54:51 am
Installed, works fine. German translation added. Is there any need of translating the help text? I didn't find where the translation is used anyway.

Some news on the editor problem?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on February 10, 2016, 05:59:07 am
I don't know if this addon will be updated, probably it will be included into the next major release 1.1
Maybe Emanuele or Spuds can give us more information
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on February 10, 2016, 10:19:24 am
ILA has been merged into 1.1, so its unlikely that I will update this 1.0 version.  The main missing part from this version was the UI in the posting page, so I may add something but I'm in no rush.

However bugs are welcome to be reported since it this has bugs then of course they exist in 1.1 as well !  I thinik @emanuele also added the ability to call a specific attachment by id in 1.1 vs the post "owned" numbered approach here.

Thanks for the translation :D ... yeah no need on the help translation since that ? icon to bring it up is missing in this version ... and the version in 1.1 will be somewhat different.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on February 10, 2016, 10:44:30 am
Yep, for the moment I changed it to:
Code: [Select]
[attach]123[/attach]
because is the easiest and allow to add more stuff as parameter.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on February 10, 2016, 12:53:03 pm
We will probably want to have a conversion from 1.0 addon to 1.1 core  O:-)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on February 10, 2016, 03:03:12 pm
Yep, that is one more thing to do... :-\
But I was thinking of pushing it to beta 2 since it's not "really" urgent (because anyway I used a different tag, so the "old" ila can still live on its own).
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on February 10, 2016, 04:23:53 pm
Just something to track for 1.1 GA .. does not need to be in the betas for sure, but would be nice to have an upgrade (even if its a separate utility that gets run)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on April 10, 2016, 03:02:03 pm
I'm having some errors in ElkArte log for the attachments inserted with
Code: [Select]
[attachurl=1]
In my case there are two pdf inserted inline, it's an old topic imported from SMF+ILA

Type of error: General
 sprintf(): Too few arguments
File: /../sources/subs/ILA.subs.php
Line: 561

where line 561 is:
Code: [Select]
					</a> (' . $this->_attachment['size'] . ($this->_attachment['is_image'] ? ', ' . $this->_attachment['real_width'] . 'x' . $this->_attachment['real_height'] . ' - ' . sprintf($txt['attach_viewed'], $this->_attachment['downloads']) : ' ' . sprintf($txt['attach_downloaded'] . $this->_attachment['downloads'])) . ')';

I don't know id it worth to fix it now or wait for the 1.1 release ;)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Frenzie on April 10, 2016, 04:07:22 pm
Code: [Select]
sprintf($txt['attach_downloaded'] . $this->_attachment['downloads'])
I assume that . is meant to be a ,.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on April 10, 2016, 05:53:54 pm
That looks like the fix to me as well ....
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on April 10, 2016, 06:21:04 pm
Yep, that solved my problem, thank you!
Title: Re: [ADDON][WIP] In Line Attachments
Post by: stanstrup on June 17, 2016, 05:08:24 am
Doesn't seem to work in the preview?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on July 18, 2016, 08:06:13 am
As you can see here (http://forum-alternative-antriebe.de/index.php/topic,5858.0.html) thumbnails are a bit blurry. Is there a way to change it? I used the link of the thumbnail in my start page (http://forum-alternative-antriebe.de/) where the picture looks perfectly clear. So it seems ILA does this to the thumbnail?!?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on July 19, 2016, 02:47:23 am
/me sees fine
QuoteGäste dürfen keine Anhänge anschauen
:P
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on July 19, 2016, 02:51:36 am
Oh, sorry. Try again please.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on July 19, 2016, 02:59:43 am
Ok, the main problem is that the size of the thumb is smaller than the size of the image:
http://forum-alternative-antriebe.de/index.php?action=dlattach;topic=5858.0;attach=7555;image
is 150px wide, while the ILA is 250.
I seem to remember ILA thumbnails are created from the normal attachment thumbnails, so... make the normal thumbnails bigger in the admin panel:
admin > forum > attachments and avatars > attachment settings
down in the thumbnail settings use something like 250 or 300.
Then, you'll get bigger "normal" thumbnails, that you will fix adding:
Code: [Select]
.attachment_thumb > a > img {
    max-width: 150px;
}
to your custom.css... I hope. :P
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on July 19, 2016, 03:06:18 am
Quote from: emanuele – I seem to remember ILA thumbnails are created from the normal attachment thumbnails, so... make the normal thumbnails bigger in the admin panel:
admin > forum > attachments and avatars > attachment settings
down in the thumbnail settings use something like 250 or 300.

I changed this to 250px max. It works without changing the custom CSS. 250px is okay with me.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on July 19, 2016, 03:19:55 am
:D
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on August 23, 2017, 01:14:36 am
A member attached three pictures and used the code attachimg for all three images. This is what happened:
http://forum-alternative-antriebe.de/index.php/topic,2279.msg119188.html#msg119188
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Frenzie on August 23, 2017, 03:13:24 am
That can't be good for the seats… oh right, the issue.

It looks like .quickbuttons::after does a clear:both, but maybe .quickbuttons should too?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on August 23, 2017, 09:26:15 am
Don't know what happened, as guest seems fine, beside the fact that images inserted with attachimg are not responsive. I posted a solution in this thread if you are interested ;)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: live627 on August 24, 2017, 01:12:22 am
Maybe it's browser specific? Firefox 54 here...
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Frenzie on August 24, 2017, 04:46:27 am
Quote from: live627 – Maybe it's browser specific? Firefox 54 here...
Just make your window a little less wide and it won't occur.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: emanuele on August 24, 2017, 07:09:14 pm
Try adding this "somewhere" (i.e. custom.css):
Code: [Select]
.inner:after {
    content: "";
    display: block;
    clear: both;
}
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on May 29, 2018, 09:49:06 am
So now I upgraded from 1.0.x to 1.1.3 and the old ILA code is not working any more, as you can see here:

https://forum-alternative-antriebe.de/index.php/topic,7575.0.html

I installed the addon again, but it's not working (even when I edit a post and save it again). That's something I feared.  :-X
Title: Re: [ADDON][WIP] In Line Attachments
Post by: ahrasis on May 29, 2018, 10:35:19 am
I thought ILA is a default feature in 1.1, right?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: b4pjoe on May 29, 2018, 10:38:33 am
Yes it is and it works great.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: ahrasis on May 29, 2018, 10:50:20 am
Thank you for confirming that @b4pjoe. I guess you have to remove that addon @Jorin as it may be conflicting with the default?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on May 29, 2018, 11:36:22 am
The addon uses a completely different BBC then the standard feature in ElkArte 1.1. So 1.1 can't show inline images made with the addon. And the addon doesn't work with 1.1.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Mrs. Chaos on May 29, 2018, 12:40:05 pm
A stupid question.
How do I insert an ILA in 1.1.x if it is default there? By BBC tags? But between the others I can't find any for the ILA ... :-[
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on May 29, 2018, 12:41:40 pm
This was or still is an addon. It can be installed with the package manager.  ;)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: b4pjoe on May 29, 2018, 12:58:16 pm
It can be installed but it no longer works and yes that is right, ILA made with the addon no longer show the images in 1.1.x.

The BB code for the ILA in 1.1.3 is:

Code: [Select]
[attach width=400]XXXXX[/attach]

but you don't know what XXXXX is to start with. Once you add the attachment to a post you click this button which gives the options to attach the image inline:

(Link-5862)

Select your options and it adds the BB code like this:

Code: [Select]
[attach width=300]post_tmp_40_fbae146c99437cf483d1a31e1a0e3f7a[/attach]

with a temporary name that it changes to the permanent name after you post your message like this:

Code: [Select]
[attach width=300]5862[/attach]
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on May 29, 2018, 01:01:11 pm
I also used ILA add-on on elkarte 1.0.x and after updating to elkarte 1.1 I did not installed this add-on. I am using the inline images function included into elkarte 1.1. I know old attachments are not displayed inline, so I did a search and replaced most of them manually. Not the best solution but I didn't have alternatives. Ila add-on was used only by a few members because there was no menu to place inline images and people hate to write bbcode
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on May 29, 2018, 01:01:27 pm
I know that and this has nothing to do with my problem. But thanks for explaining others how to use the default feature.  ;)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: b4pjoe on May 29, 2018, 01:04:08 pm
Sorry, I added the instructions for Mrs. Chaos question.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on May 29, 2018, 01:10:59 pm
Oh, sorry.  :-[
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Mrs. Chaos on May 29, 2018, 01:43:34 pm
Quote from: Jorin – This was or still is an addon. It can be installed with the package manager.  ;)

Quote from: radu81 – I also used ILA add-on on elkarte 1.0.x and after updating to elkarte 1.1 I did not installed this add-on. I am using the inline images function included into elkarte 1.1.

Aha, okay. I thank both of you! :)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Jorin on June 01, 2018, 02:56:44 am
Quote from: ahrasis – The ILA problem should be supported by the addon author, I think, on creating a script to convert from ILA to default feature in 1.1.3. I suspect automatic database edits will have to come together with that script.

I promised to look if the problem can be solved via SQL. That's what I archieved right now:

Code: [Select]
select att.id_msg, att.id_attach, msg.body
from elkarte_messages msg, elkarte_attachments att
where att.id_msg=msg.id_msg
and att.attachment_type=0
order by 1,2;

...selects all messages with attachments that are not thumbnails (because we only want the real images, not the from Elk created thumbnails), sorted by message and attachment id. That's a list we can work with. Now we create a help table to work with:

Code: [Select]
create table help_msg_attachments
(
msg_id int(11),
attachment_id int(11),
body longtext,
body_new longtext,
ordinal int(11)
)
CHARSET=UTF8;

Now we can fill the table, first with only one message to play with:

Code: [Select]
insert into help_msg_attachments (msg_id, attachment_id, body)
select att.id_msg, att.id_attach, msg.body
from elkarte_messages msg, elkarte_attachments att
where msg.id_msg=91684
and att.id_msg=msg.id_msg
and att.attachment_type=0
order by 1,2;

(Link-5869)

Next step: We must find out how we handle different alignments and different types of old ILA codes (for example thumbnail or image). Maybe we have to skip this and only use thumbnails without alignment for the converted codes? Don't know the best solution right now as I used both with the old addon. Alignment for my car reviews, no alignment in other threads.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Mrs. Chaos on June 01, 2018, 04:08:13 am
Quote from: radu81 – I am using the inline images function included into elkarte 1.1.

@radu81  Where is this included inline images function??? Except the BBC tag for normal inserting of images, I can't find anything. :-[
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on June 01, 2018, 04:34:42 am
Go to Admin > Forum > Attachments & Avatars > Attachments settings, and scroll down, the last setting should be "Enable inline attachments"
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Mrs. Chaos on June 01, 2018, 04:58:23 am
Oh, I get an error message there:
count(): Parameter must be an array or an object that implements Countable

What does that mean exactly?
All other pages under "Attachments & Avatars" are working normally.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: tino on June 01, 2018, 06:06:32 am
https://www.elkarte.net/community/index.php?topic=5228.0

Probably the same issue as there?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Mrs. Chaos on June 01, 2018, 07:21:02 am
Yes, thank you, that was it. :)
Just the alteration, that is suggest by Emanuele there, worked.

Is there a new BBC button for this, that I can or must add, or do I have to write allways something in the text like [attach] ?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on June 01, 2018, 07:35:33 am
Yes, there is a button 
(Link-2626)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Mrs. Chaos on June 01, 2018, 08:22:18 am
I've tried it now. Everything works and looks great.
Thank you guys! :)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: JPalmer on September 24, 2020, 09:58:42 am

Read this thread because I'm interested in the solution .. but I cannot find the "share" button on my attachments. So, I can't use that temp image file name in the [attach] tag. What could be wrong?
Title: Re: [ADDON][WIP] In Line Attachments
Post by: Spuds on September 24, 2020, 10:41:11 am
Are you using Elk 1.1 and the default theme?  Just wanted to check first since this addon is not required in 1.1 (its build in)
Title: Re: [ADDON][WIP] In Line Attachments
Post by: JPalmer on September 24, 2020, 11:06:48 am
Quote from: Spuds – Are you using Elk 1.1 and the default theme?  Just wanted to check first since this addon is not required in 1.1 (its build in)

Sorry, guess I was too short in my description (and probably also in the wrong place). I have tried the add-on, it didn't seem to do anything, and then after I found this old thread I uninstalled it.

Bottom line, now I am on v1.1.6, and use the Default Theme .. and on the list of attachments the only button that shows is the "delete" button.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on September 24, 2020, 02:31:31 pm
If you are on 1.1.6 you don't need this add-on, just uninstall it if you have it installed.
To use inline attachments in elkarte 1.1 you need to go to: Admin -> Forum -> Attachments and Avatars -> Attachments settings and enable the option Enable the display of in line attachments
Title: Re: [ADDON][WIP] In Line Attachments
Post by: JPalmer on September 24, 2020, 04:19:46 pm
Quote from: radu81 – If you are on 1.1.6 you don't need this add-on, just uninstall it if you have it installed.
To use inline attachments in elkarte 1.1 you need to go to: Admin -> Forum -> Attachments and Avatars -> Attachments settings and enable the option Enable the display of in line attachments

Yes, I did that .. my problem is how to get to the link. In one of the earlier posts a screen shot is shown where there are options next to an attachment:

(Link-5862)

.. and I don't have this button, not to speak of it's options. The only button visible is the delete button.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on September 24, 2020, 05:02:01 pm
that's strange, if you are using 1.1.6 with that option enabled you should see that button.
Title: Re: [ADDON][WIP] In Line Attachments
Post by: JPalmer on September 24, 2020, 05:37:00 pm
Quote from: radu81 – that's strange, if you are using 1.1.6 with that option enabled you should see that button.

ohhh wait ... I just wanted to see if another theme would show different results. I switched the layout, and the button was there! Then switched again, back to the default theme .. and the button is still there!

Not sure what happened here. Could it be that my tests with the obsolete plugin confused some of the theme styles or layout?

Either way, the problem seems to be gone. Thanks for taking the time to reply!
Title: Re: [ADDON][WIP] In Line Attachments
Post by: JPalmer on September 25, 2020, 08:09:08 am
Quote from: JPalmer –
Quote from: radu81 – that's strange, if you are using 1.1.6 with that option enabled you should see that button.

ohhh wait ... I just wanted to see if another theme would show different results. I switched the layout, and the button was there! Then switched again, back to the default theme .. and the button is still there!

Not sure what happened here. Could it be that my tests with the obsolete plugin confused some of the theme styles or layout?

Either way, the problem seems to be gone. Thanks for taking the time to reply!

Miracle solved, I think .. I'm using an ad/popup blocker, and as it stands it prevents the button from being displayed. Whitelisting my forum domain helped.

As a tip to others .. before you chase weird effects make sure to try with ad blockers disabled!
Title: Re: [ADDON][WIP] In Line Attachments
Post by: radu81 on September 25, 2020, 01:54:43 pm
Good to know, thanks for sharing ;)