RT to show the phpwcms-Version, the Revision date and the Revision No in frontend.
The output format of the revision date can be controlled from the tag.
Used for the output the standard php-date rules, see PHP: date - Manual
rt_phpwcms_version_date_revision V1.0 24.06.2012
Docu: –
Forum: Revisions NR. von phpwcms als "ReplacementTag" vorhanden ?
Author: K.Heermann (flip-flop) http://planmatrix.de
CMS Version: >= 1.3
Version: V1.0
TAGs: {PHPWCMS_VERSION}, {PHPWCMS_RELEASE_DATE} und {PHPWCMS_REVISION}
Filename: rt_phpwcms_version_date_revision.php
Folder: template/inc_script/frontend_render/
Condition: → /config/phpwcms/conf.inc.php
This example shows the TAGs for the output of the version 1.5.4 from 29.05.2012 Rev 490:
- {PHPWCMS_VERSION} ==> 1.5.4 - {PHPWCMS_REVISION} ==> 490 - {PHPWCMS_RELEASE_DATE:l, j. F Y lang=DE} => Dienstag, 29. Mai 2012 - {PHPWCMS_RELEASE_DATE:d.m.Y} => 29.05.2012 - {PHPWCMS_RELEASE_DATE} => 2012/05/29 (Immer Y/m/d ...)
TRANSLATE
Das Revisonsdatum kann mit drei verschiedenen Aufrufen abgefragt werden.
In template or a suitable CP:
Version: {PHPWCMS_VERSION} <br /> <br /> Release date: <br /> -----------------------<br /> {PHPWCMS_RELEASE_DATE} <br /> {PHPWCMS_RELEASE_DATE:l, j. F Y lang=DE} <br /> {PHPWCMS_RELEASE_DATE:l, j. F Y lang=ES} <br /> {PHPWCMS_RELEASE_DATE:l, j. F Y} <br /> <br /> {PHPWCMS_RELEASE_DATE:d.m.Y H:i:s} <br /> <br /> Revision: {PHPWCMS_REVISION}
Frontend output:
Version: 1.5.4 Release date: ----------------------- 2012/05/29 Dienstag, 29. Mai 2012 Martes, 29. Mayo 2012 Tuesday, 29. May 2012 29.05.2012 00:00:00 Revision: 490
Filename: rt_phpwcms_version_date_revision.php
Folder: template/inc_script/frontend_render/
rt_phpwcms_version_date_revision
<?php /** ********************************************************************************************* * Bereitstellen der TAGs: {PHPWCMS_VERSION}, {PHPWCMS_RELEASE_DATE} und {PHPWCMS_REVISION} * 24.06.2012 KH * * Das Datum kann in drei unterschiedlichen Varianten angegeben werden: * 1. {PHPWCMS_RELEASE_DATE:l, j. F Y lang=DE} => Dienstag, 29. Mai 2012 (Siehe: http://www.php.net/manual/de/function.date.php) * 2. {PHPWCMS_RELEASE_DATE:d.m.Y} => 29.05.2012 * 3. {PHPWCMS_RELEASE_DATE} => 2012/05/29 (Immer Y/m/d ...) * ********************************************************************************************** */ // ---------------------------------------------------------------- // obligate check for phpwcms constants if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day."); } // ---------------------------------------------------------------- if( ! (strpos($content["all"],'{PHPWCMS_')===false)) { $content["all"] = str_replace('{PHPWCMS_VERSION}', PHPWCMS_VERSION, $content["all"]); $content["all"] = str_replace('{PHPWCMS_REVISION}', PHPWCMS_REVISION, $content["all"]); $date = strtotime(PHPWCMS_RELEASE_DATE); // nach unix Timestamp wandeln // Datum formatiert z.B.: {PHPWCMS_RELEASE_DATE:l, j. F Y lang=DE} => Dienstag, 29. Mai 2012 // Siehe: http://www.php.net/manual/de/function.date.php $content["all"] = preg_replace('/\{PHPWCMS_RELEASE_DATE:(.*?) lang=(..)\}/e', 'international_date_format("$2","$1","'.$date.'")', $content["all"]); // Datum formatiert einfach z.B.: {PHPWCMS_RELEASE_DATE:d.m.Y} => 29.05.2012 (Immer EN-Format) $content["all"] = preg_replace('/\{PHPWCMS_RELEASE_DATE:(.*?)\}/e', 'date("$1",'.$date.')', $content["all"]); // Datum einfach: {PHPWCMS_RELEASE_DATE} => 2012/05/29 (Y/m/d) $content["all"] = str_replace('{PHPWCMS_RELEASE_DATE}', PHPWCMS_RELEASE_DATE, $content["all"]); } ?>