Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#81 2018-10-05 15:39:22

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,415
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Maybe sticking with language convention is the smart way. Certainly efficient. I wouldn’t worry about it.

Offline

#82 2018-10-05 15:44:22

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,415
Website

Re: smd_article_stats: Article stats to count words 'n stuff

I must have used en-GB before when seeing the comma, because when switching from fr to en just now I get this yellow warning:

No locale available for language English. Using default locale instead.

What would be the default in that case, British?

Offline

#83 2018-10-05 16:03:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,644
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Destry wrote #314421:

when switching from fr to en just now I get [a] warning.

Yeah this is where our locale/language thing breaks down a bit. Or where the entire locale/language thing breaks down, I’m not sure which it is.

Basically we have a giant lookup table that maps a language designator to a locale. When we used full language designators (en-GB, en-US etc) it was easy because they usually have a direct locale analogue. Now we have “short” designators there’s not always a mapping. There’s no explicit locale for OED English en for example.

If you look in textpattern/vendors/Textpattern/L10n/Locale.php you’ll see the table near the top of the file. Notice that the entry for ‘en’ is missing? That’s probably why you get that warning. And this leads to your next point…

What would be the default in that case, British?

… if the system can’t find a locale it reverts to the system default which is usually ‘C’. For, uhhh, “Common” or “Can’t find it” … I’m not sure.

What do we do about this? I don’t know. Do we add an entry for our short langs and just pick a locale even though it might not be right? Do we leave it up to the system (as we do now) and issue the warning, which delivers correct information to you, but is potentially confusing? Or do we do something else?

I’m a little ignorant in this department so if anyone is more clued up then please open a topic for discussion somewhere.

P.S. if you want to see all locales your system supports, open a Terminal and issue:

locale -a


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#84 2018-10-06 18:30:12

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,415
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Bloke,

If I may offer… I’d suggest using the Modern Humanities Research Association,‘s recommendation for handling the generic en dates, numbers, currency, etc.

The MHRA is largely based on the Oxford Style Manual, and some of it’s board members are even Oxford researchers. So if you’re considering the en spelling as OED, then this is just another pea in the same pod.

(This is the style manual I use for all my sites too.)

Dates are of the format 6 October 2018.

For numbers, they define no separator up to 9999, then a comma beginning 10,000.

While this is not what I wanted to do from a design standpoint, I will be the first to say this is a solid way to address the missing en format for Txp, and especially as it’s based on the Oxford U way of things.

I would be happy to use smd_article_stats under the en language by the above format. I’m a sucker for convention.

Offline

#85 2019-10-22 10:40:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,644
Website

Re: smd_article_stats: Article stats to count words 'n stuff

New version 0.5.0 is out for Txp 4.7.x (finally):

  • Registered public tag.
  • Fixed erroneous template comment.
  • Updated and fixed available stats panel locations for 4.7 UI (thanks, phiw13).
  • Corrected and expanded French language Textpack (thanks, phiw13).

As always, report any issues and I’ll tend to them when I can. Enjoy!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#86 2019-10-22 11:01:27

etc
Developer
Registered: 2010-11-11
Posts: 3,780
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Bloke wrote #319812:

Registered public tag.

Hehe, we’ve finally found a method :-)

Offline

#87 2019-10-23 06:59:56

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,049
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Small issue (v 0.5.0): on the plugin panel, clicking on the “options” link leads to a restricted page instead of the expected prefs panel Going manually to the Prefs panel > smd_article_stats works fine.

The URL I get from the plugins panel: /textpattern/index.php?event=plugin_prefs.smd_article_stats

This is on my local testing install running 4.8.0 dev. But same result on a live server running TXP latest release.

The options link for some other (smd_) plugins work as expected.


Where is that emoji for a solar powered submarine when you need it ?

Offline

#88 2019-10-23 10:46:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,644
Website

Re: smd_article_stats: Article stats to count words 'n stuff

phiw13 wrote #319833:

on the plugin panel, clicking on the “options” link leads to a restricted page instead of the expected prefs panel

Good catch, thank you. Fixed in v0.5.1.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#89 2020-03-09 12:59:27

M_i
Member
Registered: 2006-03-05
Posts: 121

Re: smd_article_stats: Article stats to count words 'n stuff

Hi,

I’m updating an ancient Textpattern site that I built back in 2006 because my host is shutting off PHP 5.4 soon. I started out with Textpattern 4.0.4 on PHP 5.4 and have managed to update to Textpattern 4.8, which I have running on PHP 7.2.

Now I’m trying to get all the plugins up and running again, and hit a little snag with this one. On the old TXP 4.0.4 site, using version 0.21 of this plugin, I had a <txp:smd_article_stats item=“body” /> tag on both the form for the article itself and on article list forms, and both worked. On the updated site, running version 0.5.1 of smd_article_stats, the word count only displays on the individual article, not on the article lists.

From the documentation, I’m not entirely sure if it’s even supposed to show a word count on article lists, or that it’s exclusively for individual articles, but as said, it used to work. Should it still work? And if not, is there another plugin I could try to display word count on article lists?

Any help would be much appreciated!
thanks,
iris

Offline

#90 2020-03-09 13:37:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,644
Website

Re: smd_article_stats: Article stats to count words 'n stuff

M_i wrote #322104:

<txp:smd_article_stats item=“body” /> tag on both the form for the article itself and on article list forms, and both worked. On the updated site, running version 0.5.1 of smd_article_stats, the word count only displays on the individual article, not on the article lists.

That’s strange. It should work the same. On article lists, Txp jumps to “individual article” context whenever each article is rendered via the list form, so it has access to all the article information like title, body text, and custom fields, etc.

I shall test it on my site when I’m back at my laptop and let you know if I find anything untoward. If not, we can have a go at debugging why you’re seeing this behaviour on your site.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

Board footer

Powered by FluxBB