[3.2][RC] Inline attached images

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Anti-Spam Guide
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Post Reply
Big Monstro
Registered User
Posts: 59
Joined: Tue Nov 15, 2016 5:42 pm

[3.2][RC] Inline attached images

Post 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 [email protected]'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
Last edited by Big Monstro on Sat Aug 18, 2018 12:18 am, edited 6 times in total.
User avatar
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 11073
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo
Contact:

Re: [RC] Inline attached images

Post 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... ;)
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies | Styles Queue Stats :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate.
:flag_es: phpBB Spain - Online Since 2003 :heart:


Big Monstro
Registered User
Posts: 59
Joined: Tue Nov 15, 2016 5:42 pm

Re: [3.2][RC] Inline attached images

Post by Big Monstro »

Hello,

I edited to comply with the rules.

Thank you for the future feedback!

Be indulgent: it's my first extension.
Last edited by Big Monstro on Fri Aug 17, 2018 9:23 pm, edited 1 time in total.
User avatar
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 11073
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo
Contact:

Re: [3.2][RC] Inline attached images

Post 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. ;)
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies | Styles Queue Stats :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate.
:flag_es: phpBB Spain - Online Since 2003 :heart:


Big Monstro
Registered User
Posts: 59
Joined: Tue Nov 15, 2016 5:42 pm

Re: [3.2][RC] Inline attached images

Post 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) ?
User avatar
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 11073
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo
Contact:

Re: [3.2][RC] Inline attached images

Post by Raul [ThE KuKa] »

Or you can delete the "homepage" line until the extension is validated, for example... ;)
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies | Styles Queue Stats :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate.
:flag_es: phpBB Spain - Online Since 2003 :heart:


User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: [3.2][RC] Inline attached images

Post by AlfredoRamos »

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
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
zzonde
Registered User
Posts: 4
Joined: Mon Aug 06, 2018 10:59 am

Re: [3.2][RC] Inline attached images

Post 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.
Big Monstro
Registered User
Posts: 59
Joined: Tue Nov 15, 2016 5:42 pm

Re: [3.2][RC] Inline attached images

Post 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 amWould be cool if the images could be cropped to the same size.
You can generate thumbnails for larger images attachments.
focp
Registered User
Posts: 47
Joined: Mon Feb 15, 2016 10:59 am

Re: [3.2][RC] Inline attached images

Post 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 ?
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.2][RC] Inline attached images

Post by </Solidjeuh> »

Yes, portal problem confirmed
igorbond
Registered User
Posts: 138
Joined: Sun Mar 24, 2013 5:54 pm

Re: [3.2][RC] Inline attached images

Post by igorbond »

Not compatible with Extension Highslide https://www.phpbbguru.net/community/vie ... hp?t=42666
Image
focp
Registered User
Posts: 47
Joined: Mon Feb 15, 2016 10:59 am

Re: [3.2][RC] Inline attached images

Post 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,
Big Monstro
Registered User
Posts: 59
Joined: Tue Nov 15, 2016 5:42 pm

Re: [3.2][RC] Inline attached images

Post 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+.
Post Reply

Return to “Extensions in Development”