Page 1 of 1

[3.2][RC] Inline attached images

Posted: Fri Aug 17, 2018 8:30 pm
by Big Monstro
Extension Name: Inline attached images
Author: Big Monstro

Extension Description: Displays attached images as inline elements
Extension Version: 1.0.0-RC1

Features: There are some significant differences between my extension and the previous Anv@r.all's one:
  • Intended for phpBB 3.2. I've tested on a server running PHP 7 and phpBB 3.2.2 but it should work on any phpBB 3.2.x installation.
  • The older extension turned attached images into inline element by CSS. I made a completely approach by using phpBB events.
  • It displays attached images as inline elements everywhere, even in printview pages (unlike the older extension).
  • File comments for attached images are now displayed in tooltip text (title attribute for images).
Extension Download: http://www.mediafire.com/file/q48mj5dbl ... 1.zip/file

Re: [RC] Inline attached images

Posted: Fri Aug 17, 2018 8:47 pm
by Raul [ThE KuKa]
Hello,

Please make a correct post about your extension:
https://www.phpbb.com/extensions/rules- ... rmat-rules

And select the Topic Prefix, your prefix is RC but, [3.2][RC] I think is better... ;)

Re: [3.2][RC] Inline attached images

Posted: Fri Aug 17, 2018 9:13 pm
by Big Monstro
Hello,

I edited to comply with the rules.

Thank you for the future feedback!

Be indulgent: it's my first extension.

Re: [3.2][RC] Inline attached images

Posted: Fri Aug 17, 2018 9:23 pm
by Raul [ThE KuKa]
Most feedback... ;)

Your composer.json file.

Line 5: "homepage": "Not valided by phpBB Team", please, you must change this...

Line 20: "phpbb/phpbb": ">=3.2.*@dev"

I think it would be better this way...
"phpbb/phpbb": ">=3.2.0" or "phpbb/phpbb": ">=3.2.0,<3.3@dev"

Thanks and best regards. ;)

Re: [3.2][RC] Inline attached images

Posted: Fri Aug 17, 2018 9:32 pm
by Big Monstro
For the extension homepage, I assumed the best link would be http://www.phpbb.com/customise/db/extension/{extension_name}

I don't have a dedicated website for PHP/phpBB extensions. Unless this extension is finally validated, the homepage field is pointless.

Maybe should I left that field empty, remove it or set that topic URL (http://www.phpbb.com/community/viewtopic.php?t=2482551) ?

Re: [3.2][RC] Inline attached images

Posted: Fri Aug 17, 2018 9:36 pm
by Raul [ThE KuKa]
Or you can delete the "homepage" line until the extension is validated, for example... ;)

Re: [3.2][RC] Inline attached images

Posted: Fri Aug 17, 2018 9:59 pm
by AbaddonOrmuz
The homepage can be the link to the public repository too, where the code is available.

https://area51.phpbb.com/docs/dev/3.2.x ... poser-json

Re: [3.2][RC] Inline attached images

Posted: Sun Aug 19, 2018 9:26 am
by zzonde
Really great and it works with the Lightroom ext.

Ideas: Any way to add settings for padding, margins etc in ACP? Would be cool if the images could be cropped to the same size.

Re: [3.2][RC] Inline attached images

Posted: Mon Aug 20, 2018 2:51 pm
by Big Monstro
Thank you for the first feedbacks :)

Any comment about listener.php ?

According to phpbb\textformatter\s9e\factory.php, the attachment BBcode is set by that line:

Code: Select all

$templates['attachment'] = $fragments['inline_attachment_open'] . '<xsl:comment> ia<xsl:value-of select="@index"/> </xsl:comment><xsl:value-of select="@filename"/><xsl:comment> ia<xsl:value-of select="@index"/> </xsl:comment>' . $fragments['inline_attachment_close'];
These two $fragments actually are <div class="inline-attachment"> and </div> (set in bbcode.html of each board style ; it's a block HTML tag, despite the class name). Therefore, in listener.php, I replaced div by span (to turn block HTML tag into inline HTML tag, without loading CSS rule)

Code: Select all

$event['configurator']->tags['attachment']->template = '<span class="inline-attachment">' . '<xsl:comment> ia<xsl:value-of select="@index"/> </xsl:comment><xsl:value-of select="@filename"/><xsl:comment> ia<xsl:value-of select="@index"/> </xsl:comment>' . '</span>';
However, it would be better to replace only $fragments['inline_attachment_open'] and $fragments['inline_attachment_close'], so that the extension wouldn't need to be rewritten if a future phpBB version replace the code between these two fragments in factory.php '<xsl:comment> ia<xsl:value-of select="@index"/> </xsl:comment><xsl:value-of select="@filename"/><xsl:comment> ia<xsl:value-of select="@index"/> </xsl:comment>'. Moreover, it would be even better if the BBcode replacement code only occurs if the attachment is an image or a thumbnail (flash and other attachments are still block elements anyway).

Any idea?
zzonde wrote:
Sun Aug 19, 2018 9:26 am
Would be cool if the images could be cropped to the same size.
You can generate thumbnails for larger images attachments.

Re: [3.2][RC] Inline attached images

Posted: Mon Nov 05, 2018 5:17 pm
by focp
hi, just tried the extension, and it works fine,
but when used on a board with board3 portal i get the following error message and the portal does not display,

Unable to find template "portal/portal_body.html" (looked into: /var/sites/f/mysite/public_html/styles/prosilver/template, /var/sites/f/mysite/public_html/styles/prosilver/theme, /var/sites/f/fmysite/public_html/styles/all/template, /var/sites/f/mysite/public_html/ext/bigmonstro/inlineimage/styles/all/template).

the file "portal/portal_body.html" does not exist in any of the installed styles (prosilver is the default)
but is in "/public_html/ext/board3/portal/styles/prosilver/template/portal"

any clues on how to fix this please ?

Re: [3.2][RC] Inline attached images

Posted: Mon Nov 05, 2018 6:03 pm
by </Solidjeuh>
Yes, portal problem confirmed

Re: [3.2][RC] Inline attached images

Posted: Thu Nov 22, 2018 4:36 pm
by igorbond
Not compatible with Extension Highslide https://www.phpbbguru.net/community/vie ... hp?t=42666

Re: [3.2][RC] Inline attached images

Posted: Mon Dec 03, 2018 11:35 am
by focp
is this extension still being developed ?
it would be a shame if it were not, as it would be a good thing to have,

Re: [3.2][RC] Inline attached images

Posted: Fri Jan 11, 2019 8:05 pm
by Big Monstro
Hello focp,

Nobody gave a way to replace $fragments['inline_attachment_open'] & $fragments['inline_attachment_close'] (see post published on 20th August) and nobody replied between late August and November, so I thought nobody actually needs it. Therefore I simply dropped the development.

I've tested the extension with a phpBB installation without any other extension, so the interaction with other extensions were not tested.

For your problem with Board3 Portal (https://www.phpbb.com/customise/db/exte ... portal_ext), I suspect there is a conflict between my function attachments_modify_template (listener.php) and that extension. Moreover, Board3 Portal was designed for phpBB 3.1.5, not phpBB 3.2+.