[RFC]Quote link to quoted message

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.2/Rhea branch. Everything listed in this forum will be available in phpBB 3.2.
User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: [RFC]Quote link to quoted message

Post by JoshyPHP »

For the definition you just add a timestamp attribute. I don't know about the template as it was not decided in this topic. I assume the date is only supposed to shown when a quote author is specified so the quote_username_open fragment in bbcode.html would need to be changed I guess.

I published some preliminary work in this branch: https://github.com/phpbb/phpbb/compare/ ... cket/10620

If you whip this RFC into shape, I'll publish the template/definition changes to this branch and I'll leave to you the changes required in other places as well as the relevant tests. You can pull this branch into yours.

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC]Quote link to quoted message

Post by brunoais »

What about the date attribute? Is it not defined?

Edit:
Oh! I think I get it... It is an attribute only in the template... I c...

Worst part here is that it is hardcoded... It surely means that for the WYSIWYG it will have to be hardcoded... not cool...
Last edited by brunoais on Wed Apr 29, 2015 7:04 pm, edited 1 time in total.

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: [RFC]Quote link to quoted message

Post by JoshyPHP »

No. Attributes only need to be defined for the parser, the renderer won't care. Unless there's a reason to want users to be able to set the date manually, it's not necessary.

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: [RFC]Quote link to quoted message

Post by JoshyPHP »

I looked at how other forum softwares display quotes. Here's an Imgur album.
  • IPB: no post link or profile link, shows date.
  • MyBB: post link and date, no profile link.
  • vBulletin: post link, no date or profile link.
  • WoltLab Burning Board: post link and profile link, no date.
In my opinion, showing the date on the quote overloads the UI and is unnecessary if there's a link to the post. Having a link to the original post is a must. People are getting used to having an icon (up arrow) for it. Linking the author's name to the user profile would be alright I guess.

By the way, I looked at those screenshots several times and only just now have I noticed that IPB does in fact show the date. That's the first time I notice it (that's why it's not highlighted in the screenshot) and I take it as a sign of information overload.

User avatar
Oyabun1
Former Team Member
Posts: 20
Joined: Thu Mar 31, 2011 9:48 am

Re: [RFC]Quote link to quoted message

Post by Oyabun1 »

Depending on the board or what is being discussed the date of the post quoted may be just as important as who made the original post.
JoshyPHP wrote:That's the first time I notice it (that's why it's not highlighted in the screenshot) and I take it as a sign of information overload.
Or maybe it's just that you're not interested in the date so didn't see it. It's a well known phenomena, see for example selective attention. If some members aren't interested in the date maybe 50% of them won't see it anyway.

User avatar
Louis7777
Registered User
Posts: 394
Joined: Fri Apr 04, 2014 12:32 am

Re: [RFC]Quote link to quoted message

Post by Louis7777 »

JoshyPHP wrote:In my opinion, showing the date on the quote overloads the UI and is unnecessary if there's a link to the post. Having a link to the original post is a must.
Yes and yes. (:

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 299
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: [RFC]Quote link to quoted message

Post by Nicofuma »

Actually I like how it is handled by IPB. So for me it would be: icon to link to the post, date, author with link to the profile
Off course all of the m should be optional
Member of the phpBB Development-Team
No Support via PM

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: [RFC]Quote link to quoted message

Post by JoshyPHP »

Oyabun1 wrote:Depending on the board or what is being discussed the date of the post quoted may be just as important as who made the original post.
Sure, but in that case the actual date is only one click away.
Nicofuma wrote:Actually I like how it is handled by IPB. So for me it would be: icon to link to the post, date, author with link to the profile
Off course all of the m should be optional
Here's what I can do, but this is all going to be pretty complicated. First, I would update posting.php to add all the relevant metadata to the quote tag that is created when the "Quote" button is pressed:

Code: Select all

[quote="Username" post_id="123" post_time="1234567890" user_id="4567"]...[/quote]
If this seems too long, I'd like to point out that the following is every bit as valid from the parser's standpoint:

Code: Select all

[quote=Username post_id=123 post_time=1234567890 user_id=4567]...[/quote]
Here's the current proSilver template fragment for quotes, from bbcode.html:

Code: Select all

<!-- BEGIN quote_username_open -->
<blockquote><div><cite>{USERNAME} {L_WROTE}{L_COLON}</cite>
<!-- END quote_username_open -->
I can replace it with this:

Code: Select all

<!-- BEGIN quote_username_open -->
<blockquote><div><cite>{DATE}{USERNAME} {L_WROTE}{L_COLON}</cite>{POST_LINK}
<!-- END quote_username_open -->
I can have {DATE} be a language string built at runtime via $user->lang('ON_QUOTE_DATE', $post_time) where ON_QUOTE_DATE could be 'On %s, '.

I can have {POST_LINK} represent another, new template fragment that could look like this:

Code: Select all

<!-- BEGIN quote_post_link -->
<a href="{U_VIEWPOST}"><img src="???" /></a>
<!-- END quote_post_link -->
{U_VIEWPOST} could be generated at runtime using the quote's post_id. I don't know how images/assets are handled so I need some guidance there, preferably in the form of a working code snippet.

The interactions between all of those elements would be pretty complicated as well. Here's how I see it working:
  • If the quote has a URL, the {USERNAME} part links to it. This is the current behaviour.
  • If the quote doesn't have a URL and it is a user_id, then we generate a URL to the profile and use it as described above.
  • If the quote has a post_time, we generate a translated string for {DATE}. Otherwise, it's empty.
  • If the quote has a post_id, we generate a link for {POST_LINK}. Otherwise, it's empty.
Since {DATE} and {POST_LINK} are only used in the quote_username_open fragment, a quote that doesn't have an author doesn't get a link or a date.

I'd like to add that it took me nearly 45 minutes just to describe how it would work. That's how complicated this is and how quickly it can get out of hand.

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC]Quote link to quoted message

Post by brunoais »

I think you are complicating it. It can more easily be like this:
  • If author is set, use it to generate the author text.
  • If user_id is set, use it to generate the link over author param.
  • If post_time is set, use it to generate a date after the rest of the data.
  • If post_id is set, place the post icon with a link to that post, otherwise(!)
    1. If url is set, place a link over the author and L_WROTE (overrides user_id)
  • Execute the preprocessor on author and fill the unfilled data as stated.
How is that complicated? It's a sequence with this logic:

Code: Select all

use author
use post_time
if(post_id){
	use post_id
	use user_id
}else if(url){
	use url
}else{
	use user_id
}
preprocess author
(the above "use" mean to use if set)

I think that, conceptually, this is not in the realm of something complex. I think this is still simple. It may take some issues to deal with, for example how to display each data to the user, but I believe they are all straight forward.

User avatar
Mess
Registered User
Posts: 199
Joined: Wed Jun 13, 2012 10:14 am

Re: [RFC]Quote link to quoted message

Post by Mess »

Louis7777 wrote:
JoshyPHP wrote:In my opinion, showing the date on the quote overloads the UI and is unnecessary if there's a link to the post. Having a link to the original post is a must.
Yes and yes. (:
Agreed on both points.

Post Reply