[RFC]Quote link to quoted message
Re: [RFC]Quote link to quoted message
Hum... There's this function:bbcode_quote() in message_parser.php...
I'll need some time to study that function and prepare it for the changes... I was thinking the changes were only in bbcode.php, actually, there's more needed for this job.
This will take a while.
Any help to speed this thing up is welcome
I'll need some time to study that function and prepare it for the changes... I was thinking the changes were only in bbcode.php, actually, there's more needed for this job.
This will take a while.
Any help to speed this thing up is welcome
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: [RFC]Quote link to quoted message
For the record, afaik the BBCode system is being revamped so this could probably wait a little while until that's done.
Re: [RFC]Quote link to quoted message
viewtopic.php?f=84&t=33021 - New BBcode Engine for reference.
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
Re: [RFC]Quote link to quoted message
There is code in this post, Re: In quote link back to original post, that works with the current version of phpBB (3.0.10).
Re: [RFC]Quote link to quoted message
Code: Select all
[quote="brunoais" post="15"]dsd[/quote]
[quote="brunoais" source="http://www.phpbb.com/support/irc/"]dsd[/quote]
source
but there's an optional url
attribute as described in this post.Shouldn't
post
be called post_id
? It's possible to add a post_id
attribute that holds a number. It's possible to have a template that uses this number in a URL, something like this:
Code: Select all
<a href="{U_VIEWPOST}{NUMBER}">{L_BACK_TO_POST}</a>
core.text_formatter_s9e_render_before
event to generate a localized date and inject it in the metadata before a formatted text is displayed. Or not use an event at all and just execute the same code in the relevant context.Re: [RFC]Quote link to quoted message
JoshyPHP wrote:There's noCode: Select all
[quote="brunoais" post="15"]dsd[/quote] [quote="brunoais" source="http://www.phpbb.com/support/irc/"]dsd[/quote]
source
but there's an optionalurl
attribute as described in this post.
url
can replace source (in my spec), yes.
L_BACK_TO_POST ? It is meant to be the link to the source post of the quote. The postId is used because the forum may change location and/or domain and, that way, it would still be working as it points to a post, not an URL.JoshyPHP wrote: Shouldn'tpost
be calledpost_id
? It's possible to add apost_id
attribute that holds a number. It's possible to have a template that uses this number in a URL, something like this:Code: Select all
<a href="{U_VIEWPOST}{NUMBER}">{L_BACK_TO_POST}</a>
I think that could be solved by calling a php function from inside the XSL. What do you think?JoshyPHP wrote: It's possible to have another optional number that holds a timestamp but there's no built-in way to generate a localized date at display time. It's possible to use thecore.text_formatter_s9e_render_before
event to generate a localized date and inject it in the metadata before a formatted text is displayed. Or not use an event at all and just execute the same code in the relevant context.
Re: [RFC]Quote link to quoted message
Yes.brunoais wrote:L_BACK_TO_POST ? It is meant to be the link to the source post of the quote.
L_BACK_TO_POST
can be whatever string makes sense, that's just an example. U_VIEWPOST
would be the static part of the URL for viewing a post, e.g. https://area51.phpbb.com/phpBB/viewtopic.php?p=
. It would be set in PHP.There's no support in the library for executing arbitrary PHP while rendering a template. That's a Pandora's box I am careful not to open needlessly. That's why the simplest way to access or generate that kind of metadata is currently to inject it before rendering.brunoais wrote:I think that could be solved by calling a php function from inside the XSL. What do you think?
Re: [RFC]Quote link to quoted message
Is it possible to add the preprocessing capability to your library to process variables before they are sent to the stylesheet?
Re: [RFC]Quote link to quoted message
I think that what I'm going to do is offer a utility that rewrites attribute values inside of a parsed text (which is in XML.)
Most likely it'll be used like this:
Grab all
Most likely it'll be used like this:
Code: Select all
$xml = s9e\TextFormatter\Utils::replaceAttributes(
$xml,
'QUOTE',
function ($attributes) use ($user)
{
if (isset($attributes['timestamp']))
{
$attributes['date'] = $user->format_date($attributes['timestamp']);
}
return $attributes;
}
);
QUOTE
tags, those that have a timestamp
attribute get a date
attribute that contains the localized date.Re: [RFC]Quote link to quoted message
How would
quote
be defined with that functionality?