Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Print Page
« Reply #30, on May 13th, 2013, 11:10 AM »
Yes, parse_type is definitely buggy; it should be 'type', as per your parse_bbc code.

Tell you what... I'm seeing that most of the parse_bbc calls (about 90+ out of ~125) include a parse_type, which I think is good.
I'm thinking that, given how we'd both obviously like it to become a second nature when calling parse_bbc, we should have it outside of the array...

parse_bbc($message, $type, array(...)) or parse_bbc($message, null, array(...)) if no type is defined, which would be illogical...

There are about 30 calls with an owner ID in them, so it's about a quarter of all calls, which isn't enough to justify adding a specific parameter for user ID. I would, however, suggest looking into renaming it to 'user' or just 'u' (as in profiles), probably 'user' is better for readability; 'owner' is fine, too, but it's one extra character, and apart from thoughts and profiles, it's not a terminology that's used a lot, at least less than 'member' or 'user'.

Thoughts..? :^^;:

(I'm volunteering to change parse_type to the parameter style if you don't mind, and if you accept the change, of course.)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Print Page
« Reply #31, on May 13th, 2013, 03:25 PM »
Yeah, let me explain what happened. Initially, it was $type, then I remembered that $type was a variable used in the bowels of the system so I made the variable $parse_type but forgot to update the function reading the parameter.

If you want to move it, that's cool, I just didn't think of that. The alternative, of course, is to make post the default rather than 'unknown' and strip the parameter from any 'post' call since posts are the predominant use.

As far as owner ID goes, there's a certain logic to that. Partly because most places never had it in the first place, but secondly it's down to context. Right now owner ID is only relevant for scramble/disemvowel. But that essentially relies on $user_profile being populated with more than 'minimal' type, and without that it doesn't do anything. And of course, we need to consider whether it's appropriate - for example, I'm not sure that it would be appropriate to disemvowel or scramble posts in the Atom feed or the signature for that matter. I don't know.

I'm also cool with using 'user' rather than 'owner'.
Re: Print Page
« Reply #32, on May 13th, 2013, 03:59 PM »
Huh, forgot about the previous post as it was on the previous page.
Quote
- I'm okay with Print being a plugin; don't remember if I was before, but it just doesn't feel that important, after all... What could be improved, really, is giving the admin to ability to only print the current page's worth of posts, and/or only print the entire topic if it has less than X pages. With maybe a (single) page index inside the print page itself, to allow easy printing of multiple pages.
It wasn't a plugin before, but it strikes me how little it's really used so it might as well be a plugin. But being a plugin I can do all kinds of crazy with it. I've been thinking, for example, about making export-topic-to-PDF be an option though pagination gets tricky with that.
Quote
but suddenly it hit me that you can disable some tag types on some parse types, or hook a plugin into any type of parsing and just that one... The possibilities seem limitless.
That's the reason for being verbose in specifying all the different types.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Wanchope

  • Posts: 234
Re: Print Page
« Reply #33, on May 13th, 2013, 05:13 PM »
This is not to speak for others but Print Page code is the first thing I removed from display.php in SMF, it is not doing anything other than creating another link for the thread which is against Google SEO procedure - creating multiple links for a single post.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Print Page
« Reply #34, on May 13th, 2013, 06:16 PM »
Should I have both of these work..?

parse_bbc($message, $type, $array)
parse_bbc($message, $array)

with an is_array() test, it's easy enough. But it might be seen as disruptive. I'm so used to the jQuery style, I don't mind. But do you..?
Posted: May 13th, 2013, 06:15 PM
Quote from Wanchope on May 13th, 2013, 05:13 PM
This is not to speak for others but Print Page code is the first thing I removed from display.php in SMF, it is not doing anything other than creating another link for the thread which is against Google SEO procedure - creating multiple links for a single post.
Wedge (and possibly SMF) has two safeguards against Google...
- rel="nofollow" in the print links, meaning Google shouldn't care about that link,
- and a canonical URL set in the print page, that tells Google it should index the non-print page instead.

What more do you want.. ;)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Print Page
« Reply #35, on May 13th, 2013, 06:26 PM »
I don't really mind though my gut sort of says not to since PHP doesn't really behave that way (it's sort of an inheritance from Java's ideals concerning isomorphism). Just remember to update parse_bbc_inline with similar semantics.

As far as Google safeguards go, I'd argue it shouldn't even be indexed in the first place because it's not strictly duplicate content.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Print Page
« Reply #36, on May 13th, 2013, 06:47 PM »
Well, my gut says that most parse_bbc calls from plugins will relate to a post, so it's best to make their life easier. I'm not documenting the tweak in the function header, only in the place where I'm doing the permutation, so if they don't know about it, it's not a problem. ;)

Done with the conversions, 40 files total. All 'parse_type' are now a parameter, all 'owner' are 'user', and all 'parse_tags' (only a couple..) are 'tags'.
Will commit later tonight; I'll be offline for the evening, unfortunately, and already late... :-/
Plus, I don't want to rush, I'll check them manually again.

Wanchope

  • Posts: 234
Re: Print Page
« Reply #37, on May 13th, 2013, 06:49 PM »
Google index it anyway, sometimes you will see it 'index on error' according to Google. Forum Print is of no use (at least to me). Any user than needs to print something should copy to text editor before printing.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Print Page
« Reply #38, on May 13th, 2013, 06:49 PM »
Quote from Arantor on May 13th, 2013, 03:25 PM
If you want to move it, that's cool, I just didn't think of that. The alternative, of course, is to make post the default rather than 'unknown' and strip the parameter from any 'post' call since posts are the predominant use.
BTW, the default has always been 'post'... Even in your version ;)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Print Page
« Reply #39, on May 13th, 2013, 06:56 PM »
That's another change I made and forgot about then because when I first wrote it, it definitely was 'unknown'.

Wanchope is right: even if it is marked nofollow, Google will still view it, it just doesn't consider it for link juice following purposes, which isn't the same as noindexing.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Print Page
« Reply #40, on May 14th, 2013, 03:09 PM »
Quote from Arantor on May 13th, 2013, 06:56 PM
That's another change I made and forgot about then because when I first wrote it, it definitely was 'unknown'.
There are places where it would have failed if you'd done it that way-- including, ahem, in the most important parse_bbc call of them all, namely the one in prepareDisplayContext... ;) It didn't have a parse_type at all, so it would have been 'unknown'.

Listen, I still haven't committed my update, so if you want me to specify 'post' as the type, feel free to ask. It's much, much easier to remove these 'post' entries later, than re-adding them, since we can just do a regex search on parse_bbc.*'post', basically...
Quote
Wanchope is right: even if it is marked nofollow, Google will still view it, it just doesn't consider it for link juice following purposes, which isn't the same as noindexing.
Yes, but even then I forgot to mention, the print page ALSO has noindex... :lol: