1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-19 06:51:33 +02:00

[ticket/10620] Implemented quote improvements

PHPBB3-10620
This commit is contained in:
JoshyPHP
2015-06-16 08:16:56 +02:00
parent 8747c7a2c1
commit f02cc27014
12 changed files with 248 additions and 31 deletions

View File

@@ -77,7 +77,12 @@ class factory implements \phpbb\textformatter\cache_interface
'quote' =>
"[QUOTE
author={TEXT1;optional}
post_id={UINT;optional}
post_url={URL;optional;postFilter=#false}
profile_url={URL;optional;postFilter=#false}
time={UINT;optional}
url={URL;optional}
user_id={UINT;optional}
author={PARSE=/^\\[url=(?'url'.*?)](?'author'.*)\\[\\/url]$/i}
author={PARSE=/^\\[url](?'author'(?'url'.*?))\\[\\/url]$/i}
author={PARSE=/(?'url'https?:\\/\\/[^[\\]]+)/i}
@@ -471,24 +476,11 @@ class factory implements \phpbb\textformatter\cache_interface
$templates['li'] = $fragments['listitem'] . '<xsl:apply-templates/>' . $fragments['listitem_close'];
$fragments['quote_username_open'] = str_replace(
'{USERNAME}',
'<xsl:choose>
<xsl:when test="@url">' . str_replace('{DESCRIPTION}', '{USERNAME}', $fragments['url']) . '</xsl:when>
<xsl:otherwise>{USERNAME}</xsl:otherwise>
</xsl:choose>',
$fragments['quote_username_open']
);
$templates['quote'] =
'<xsl:choose>
<xsl:when test="@author">
' . $fragments['quote_username_open'] . '<xsl:apply-templates/>' . $fragments['quote_close'] . '
</xsl:when>
<xsl:otherwise>
' . $fragments['quote_open'] . '<xsl:apply-templates/>' . $fragments['quote_close'] . '
</xsl:otherwise>
</xsl:choose>';
// Replace the regular quote template with the extended quote template if available
if (isset($fragments['quote_extended']))
{
$templates['quote'] = $fragments['quote_extended'];
}
// The [attachment] BBCode uses the inline_attachment template to output a comment that
// is post-processed by parse_attachments()