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.