pouet0.9 icon indicating copy to clipboard operation
pouet0.9 copied to clipboard

better quotes for BBS/prod pages

Open tomaes opened this issue 12 years ago • 14 comments

[quote][/quote] Should not just say "quote", but have a more meaningful header: "Xyz said", so you can follow a discussion more easily. Should obviously account for the BBS and prod.php. Yes, this is not as trivial as it sounds.

Easy and not-that-great way, but to have it as an option: [quote userid=666][/quote]. also possible: quote buttons (no, I don't like those either). Probably not possible in a fully automated way as every matching will break (same stuff said by more than one person etc.). Maybe you have better/other ideas. :)

tomaes avatar May 08 '13 14:05 tomaes

client side javascript searching for the author of the quote and fill it in automatically. doesnt work fully in paginated mode though, but it would help a bit. probably not the best solution.

psenough avatar May 09 '13 08:05 psenough

I think it would be better to leave it up to the user. With a better BB-code parser, you could easily support both:

[quote]A snippet of some text.[/quote] [quote=AMcBain]A snippet of some previous conversation attributed to AMcBain.[/quote]

It doesn't require trying to match anything up and you don't need to know user IDs. If you don't give a value, no attribution. If you do, it's just a literal print out of what was given as a value. You could put "cookie monster" in there for all anyone cared as the attribution.

AMcBain avatar May 10 '13 21:05 AMcBain

For the sake of semantics and consistency with other tags, i'd prefer a slightly more verbose version [quote user=Satan's little helper]. Also note that users change their name quite often, but IDs remain constant. So the id would always refer to the current user name. Especially useful in older threads and prod pages.

Although both (id and arbitrary string) could be supported.

tomaes avatar May 11 '13 05:05 tomaes

Er, consistency with what other tags? According to http://pouet.net/faq.php#BB%20Code all other tags behave like [tagname=value], and I've not seen BB-code that uses your syntax, so if someone ever wanted to switch to a real BB-code parsing/formatting library it's not likely you'd find one that handles that. (but I haven't exactly searched extensively to prove this, either)

I would support both IDs and arbitrary values. Though IDs do have the bonus of remaining the same, it requires a bit more effort to do it that way when typing it out unless there was an automated quote button on posts. I should also say that a name mismatch is no worse than comments on prods at the moment, as plenty of people have called out other commentors by username with plain text and there are plenty that don't line up anymore. Fixing quote to support IDs won't "fix" that because they never intended to quote the original user in the first place: "what userx said", "userx, foo bar baz", "@userx, blah blah blah".

Plus, as I indicated above, if you support arbitrary values then people attribute quotes to [fictional] persons or things, people outside of Pouet, dead people without Pouet IDs, etc. :P

Anyway, that's just how I feel about it.

AMcBain avatar May 11 '13 05:05 AMcBain

Right, [quote id=999] and [quote=arbitraryString] can both be supported easily. The consistency argument was more about ambiguous cases where names can also be ids and vice versa, which is only important for name quotes.

tomaes avatar May 11 '13 06:05 tomaes

But I think what I was going for is that (and I asked someone else on this) nobody known uses [quote id=...] style bb-code, and at that point it almost seems like you don't actually want bb-code. I'm all about using libraries where it makes sense, and in the long run if you want better and more bb-code support, using a library there would be a good thing. However, they're probably not going to support that syntax.

The reality of it is, I haven't see anyone on pouet change their display name to all numbers, and even if people do, they're likely in the minority. So if you did [quote=...] by itself, you could make an "is number" check, and look up the username. If there is no username with that ID, leave the quote unattributed (or just print the number).

or you could do [quoteid=...], but then it gets confusing having two tags that do the same thing, instead of one that does "the right thing" almost all of the time.

Just my 2¢.

AMcBain avatar May 12 '13 05:05 AMcBain

Though ... now that I think about it, there's something with more precedence, really. Gargaj said he wanted to get work on 2.0 again, so it might be better to find out where he's heading with this (if at all) so an integration / forward-patch doesn't become a nightmare.

Edit: Okay, sorry, I think I was only partly talking out my rear-end ... there is a libbb.php which I just found, it looks like from the dump of "pouet 2" that Gargaj's is the same thing but slightly changed. So any changes would have to be worked into that. However, it doesn't look like it has support for handing even [quote=...] values and certainly has no callbacks for matches to look up anything based on the value.

I think given how it does things, in the long run that library would make it harder to add more decent support for bb-codes. Seems to be based on string find-and-replace, regex, and copy-and-paste (quote/code handlers).

AMcBain avatar May 12 '13 05:05 AMcBain

ARGH. I had such a nice rebuttal prepared. ;)

Still the points I wanted to make:

1.) There are already 3 or 4 users like that. A dozen more if you account for hex values

2.) The argument "This usually doesn't happen, let's not account for that" is terrible and a big "no-no" in software development.

3.) I think there are no changes regarding this in v2. It's also not planned according to the todo list at http://new.pouet.net/

(The deeper issue imho, is that the whole bbs/comment code needs some serious rethinking and re-modeling, but as we go for gradual change, I don't want to seriously suggest that right now. Some major cleanup is still in order to at least improve readability a bit.)

tomaes avatar May 12 '13 06:05 tomaes

No, no, I mean the header at the top of the libbb.php file in the pouet2 dump indicates Gargaj changed some things, not to add functionality, but to make it "XHTML aware" or whatever. (for the record, I think XHTML is just generally a bad idea and creates more trouble than it's worth.) That's all, really. Sorry that I guess I implied he added new features.

However, my point was that more that it might be an effort to add in new functionality to the existing bb-code library. It doesn't seem to have really been written with huge extensibility/flexibility in mind. So there probably isn't a good way to be gradual about it.

AMcBain avatar May 12 '13 06:05 AMcBain

@2 it's not "usually", have you seen anyone with an all number username?

Also, I've seen a lot of things that cover the "99"% usages and admit there are things it doesn't do. Working in software myself this is fine, as long as the % you cover is what most people use. At the library level at least, if your library doesn't do what the much smaller remaining want or need then there's usually something out there that does it. It's not always worth the time to chase after the remaining % to catch everyone if that remaining requires much more effort than it took to get the % that covers most people's needs.

It's not like the lack of differentiation where a number happens to be a nickname instead of an ID is going to kill someone. ;)

Edit: but this does give me an idea to try with my own bb-code library ... heh heh heh.

Edit edit: An existing library might be able to handle things like registering a code called "quote user" (or "quote id") but at least in mine, this then requires the ending code to be the same: [/quote user], which is kinda ugly for trying to pretend we're still the same as the simple-syntax quote tag ([quote] and [quote=...]).

AMcBain avatar May 12 '13 06:05 AMcBain

Yes, I've "seen" them.

Also, I don't like the idea of leaving obvious loopholes in the code, just to save me from writing 5 more lines of code to deal with that loophole. It's not some outrageous edge case that takes enormous effort to cover for only theoretical gain, but rather the opposite.

tomaes avatar May 12 '13 07:05 tomaes

Well, I don't know about that. As I said, most bb-code libraries including the one currently in use by Pouet, unless you want to hack on it yourself (hey, you might, I don't), don't handle that syntax. So yes, it would require much more effort to cover it than just using the library as it comes. Changing core parts of the library also makes it harder to pull in changes if the library puts out a new version with new features or fixes bugs, as you have to forward port your changes if the library maintainer doesn't want to accept a pull request / patch for it or you didn't send one.

While I might agree it's not really "outrageous", it is still an edge case.

AMcBain avatar May 12 '13 07:05 AMcBain

Going way back above, is there any reason this couldn't be done as a "[quoteid=12345]" (or [quoteuser]) instead of trying to hack on quote? It would be easier to get implemented in any case, and differentiates it well enough.

[quote]Quote as it exists now, unattributed.[/quote]

[quote=Santa Claus]Ho ho ho! This is a quote attributed to an arbitrary value, namely, me: the fictional Christmastime persona.[/quote]

[quoteid=12345]Quote attributed to the username with the ID 12345[/quoteid] [quoteuser=12345]Quote attributed to the username with the ID 12345[/quoteuser]

AMcBain avatar May 12 '13 07:05 AMcBain

Well, actually, a third idea I just had was this: if someone submits something with [quote=Nickname], it could be converted to a [quoteuser=12345][/quoteuser] if it matches a nickname, but this requires more processing when you upload a message, and if editing is ever added to messages, what they get back wouldn't be the same as what they submitted. So assuming nicknames are unique, this would allow typing in the easier thing (the nickname people see at that time) but it works out to what you want: something that autotracks with nickname changes.

AMcBain avatar May 12 '13 07:05 AMcBain