Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-05-31 02:35:25

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

mkp_version

mkp_version

This is a Textpattern plugin that adds tags for the current version number

Links

mkp_version

use <txp:mkp_version />to show the current version number.

Attributes: None

mkp_generator

use <txp:mkp_generator /> to show a meta name generator tag.

Attributes: None

mkp_if_version

A Conditional tag that compares the current version against a submitted value.

Attributes

version

Examples

<txp:version />
<txp:generator />
<txp:mkp_if_version version="4.6.2"><meta name="Textpattern" content="Current: <txp:mkp_version />" ><txp:else /><meta name="Textpattern" content="Classic: <txp:mkp_version />" ></txp:if_version>

Release History

Version 1.0: July 10th, 2015

Version 1.1: June 6th, 2016 (Updated 4.6 Tag Registry to later version)

Version 1.2: February 28th, 2017 (Bug fixes; add <txp:mkp_generator /> )

Last edited by michaelkpate (2017-02-28 18:50:53)

Offline

#2 2005-05-31 09:10:03

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: mkp_version

Thanks. Be nice if it output which revision as well.

Offline

#3 2005-05-31 10:48:09

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: mkp_version

> lee wrote:

> Thanks. Be nice if it output which revision as well.

I know, but as best I can understand, that number isn’t actually stored in the software, anywhere. Of course, you can just do it manually like Stuart does.

Offline

#4 2005-08-15 20:21:12

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: mkp_version

I finally added the feature that Lee asked for, although I am not sure how many people will care since TxP seems to be entering a more stable phase. And I would be a bit carefuly with displaying the revision number because the code is somewhat less than sub-optimal. But it does work.

Offline

#5 2005-08-16 16:42:20

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: mkp_version

I suppose mkp_revision is displaying ‘0’ for the same reason that says ‘unknown revision’ in diagnostics? So you must use svn to make this work?

Offline

#6 2005-08-16 21:20:34

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: mkp_version

I don’t think where you get the files makes any difference. ‘unknown revision’ in diagnostics means that something was not installed correctly.

Offline

#7 2005-08-16 21:28:20

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: mkp_version

Ah, found it. Thought I’d read it somewhere

Last edited by doggiez (2005-08-16 21:28:36)

Offline

#8 2005-08-19 12:08:03

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: mkp_version

Michael, any chance you could add the ‘last_update’ date and time to your plugin, like what is shown on the second line in diagnostics? I tried something myself, but could not get it to work, but I suspect it’s quite simple if you know what you’re doing (I obviously don’t).

Offline

#9 2005-08-19 16:25:47

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: mkp_version

<code> function mkp_update() { extract(get_prefs()); $fmt_date = ‘%Y-%m-%d %H:%M:%S’; return gmstrftime($fmt_date, @filemtime(txpath.’/update/_update.php’)); }</code>
// ——————————————————————————
<code> function mkp_dbupdate() { extract(get_prefs()); $fmt_date = ‘%Y-%m-%d %H:%M:%S’; return gmstrftime($fmt_date, $dbupdatetime); }</code>

I guess you mean something like this?

Last edited by michaelkpate (2005-08-19 16:28:15)

Offline

#10 2005-08-19 16:55:19

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: mkp_version

Yes, thank you!!

Am I right in assuming that the first date/time is the one the files are copied to the server, and the second the date/time that they are actually installed (update.php is run)?

Last edited by doggiez (2005-08-19 16:56:20)

Offline

#11 2005-08-19 18:47:53

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: mkp_version

I’m not sure. In my the results of my testing just now, I ended up with

<code><meta name=“update” content=“2005-08-19 15:36:11” />
<meta name=“dbupdate” content=“2005-08-19 15:36:20” /></code>

I am not sure what the difference means. But since they are only 9 seconds apart, I am not sure why someone would want to display both values.

Last edited by michaelkpate (2005-08-19 18:48:20)

Offline

#12 2005-08-19 18:50:53

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: mkp_version

michaelkpate wrote:

I am not sure why someone would want to display both values.

I wouldn’t :) Just being curious. But thanks.

Offline

Board footer

Powered by FluxBB