Table of Contents

Date: Enhanced

RT to create your own output of the date, independently of the system-TAGs. Date TAGs.

E.g. a solution to set the current copyright date (year) automatically.

The output format of the date is set directly in the script.

Used for the output the standard php-date rules, see PHP: date - Manual



rt_date_enhancedX V1.0 09.08.2011

Docu: –
Forum: –

Author: K.Heermann (flip-flop) http://planmatrix.de
CMS Version: >= 1.3
Version: V1.0

TAG: {DATEX_xxx}, e.g. {DATEX_YEAR}

Filename: rt_date_enhancedX.php

Folder: template/inc_script/frontend_render/

Condition:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_ext_render'] = 1;



Description:

This example shows the TAGs for the output of the current-year, month and day.

Settings in the replacer lines:

  • E.g.
  • - {DATEX_YEAR} = 'Y' – Returns the year
  • - {DATEX_MONTH} = 'm' – Returns the month formated in double-digit numeric
  • - {DATEX_DAY} = 'd' – Returns the day formted in double-digit numeric

You can install separate TAGs with other substitutions.

Script:

Filename: rt_date_enhancedX.php
Folder: template/inc_script/frontend_render/

rt_date_enhancedX

<?php
// ----------------------------------------------------------------
// simple date replacement: e.g. only actual year or month or day or what you like
// TAG {DATEX_xxxx}
// KH (flip-flop): 09.08.2011
// ----------------------------------------------------------------
 
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");}
// ----------------------------------------------------------------
 
if( ! (strpos($content["all"],'{DATEX_')== false)) {
 
    $content["all"] = str_replace('{DATEX_YEAR}',    international_date_format($template_default["date"]["language"], 'Y'),    $content["all"]);
    $content["all"] = str_replace('{DATEX_MONTH}',    international_date_format($template_default["date"]["language"], 'm'),    $content["all"]);
    $content["all"] = str_replace('{DATEX_DAY}',    international_date_format($template_default["date"]["language"], 'd'),    $content["all"]);
}
 
?>


english/phpwcms_replacer_rts/frontend_render/date-enhanced.txt · Last modified: 2018/06/03 18:09 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0