Textpattern CMS support forum

You are not logged in. Register | Login | Help

#51 2018-06-22 06:13:21

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,285
Website

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

Didn’t have the latest version. Thanks! All good now.

(And thanks for the textarea field, Bloke.)


Wordworkin’ for you.

Offline

#52 2018-10-02 15:16:31

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,285
Website

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

Just a request for the next round, if possible…

Some kind of visual indicator between the hundreds/thousands counts. Right now it’s just one string jammed together (8430). Be better to have notation (8,430) or perhaps more universal, and my preference, a space (8 430).


Wordworkin’ for you.

Offline

#53 2018-10-02 16:43:51

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

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

Destry wrote #314327:

Be better to have notation (8,430) or perhaps more universal, and my preference, a space (8 430).

We can actually make the global escape="number" attribute output numbers in the site locale format, e.g. 12,345.67 in the US, 12 345,67 in France and 12.345,67 in Germany. Just ask :-)

Edit: actually, it should already work in 4.7+.

Offline

#54 2018-10-02 23:12:58

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,285
Website

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

etc wrote #314331:

it should already work in 4.7+.

You mean 4.7.1, I guess? It doesn’t seem to work in 4.7.0, assuming I’m doing it right:

<txp:evaluate query='<txp:smd_article_stats item="body,excerpt" break="+" escape="number" />' />

I’ll update to 4.7.1 tomorrow. I must retire for the night.


Wordworkin’ for you.

Offline

#55 2018-10-03 07:39:47

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

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

Almost there, but <txp:evaluate /> actually kills the formatting. Try moving escape to <txp:evaluate />:

<txp:evaluate query='<txp:smd_article_stats item="body,excerpt" break="+" />' escape="number" />

Offline

#56 2018-10-03 08:26:40

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,285
Website

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

etc wrote #314340:

Try moving escape to <txp:evaluate />

Doesn’t seem to work. Now running 4.7.1. I still see a number like 7865 where I would expect to see something like 7 865, or whatever.


Wordworkin’ for you.

Offline

#57 2018-10-03 09:12:25

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

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

Destry wrote #314343:

Doesn’t seem to work. Now running 4.7.1. I still see a number like 7865 where I would expect to see something like 7 865, or whatever.

Weird, <txp:evaluate query="3456+78" escape="number" /> nicely outputs 3&nbsp;534 (seen as 3 534) for me in fr locale. What is yours?

Offline

#58 2018-10-03 13:08:46

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

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

Ah, you also need to check whether PHP intl extension is enabled.

Offline

#59 2018-10-03 15:15:06

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,285
Website

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

It would be really useful if Diagnostics could actually show the path to where things are being read, notably the PHP .ini file, because I can’t find the damn thing. I think I’m currently using the brew version, but where is that? And is php.ini.default the same as php.ini?


Wordworkin’ for you.

Offline

#60 2018-10-03 19:40:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,813
Website

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

Destry wrote #314365:

It would be really useful if Diagnostics could actually show the path to where things are being read, notably the PHP .ini file

We’re not likely to introduce this any time soon. But you can fairly easily find all manner of stuff about your server by doing this:

  1. Create an article, status: Hidden.
  2. Title it “Debug” or something equally exciting.
  3. Turn off Textile processing in the Body – Leave Untouched.
  4. Put <txp:php>phpinfo();</txp:php> in the Body field.
  5. Save the article.
  6. Click ‘View’.

Assuming you have PHP enabled in your articles (see Prefs) you’ll see a server report and in there should be the path to php.ini.

is php.ini.default the same as php.ini?

No. The latter is the actual file, the former is a backup or the one the server uses to generate the latter.

Last edited by Bloke (2018-10-03 19:41:28)


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

Offline

Board footer

Powered by FluxBB