Strict Standards: Declaration of action_plugin_dlcount::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/dlcount/action.php on line 14

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/indexmenu/action.php on line 169

Strict Standards: Declaration of action_plugin_ipban::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/ipban/action.php on line 67

Strict Standards: Declaration of action_plugin_loglog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/loglog/action.php on line 82

Strict Standards: Declaration of action_plugin_navi::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/navi/action.php on line 46

Strict Standards: Declaration of action_plugin_uparrow::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/uparrow/action.php on line 69

Strict Standards: Declaration of action_plugin_userspagecreate::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/userspagecreate/action.php on line 97

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /home/www/wiki/inc/cache.php on line 289

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/auth.php on line 312

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 71

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/actions.php on line 154
Datum: Letztes Update Artikel & CP [phpwcms-HowTo:wiki]

Strict Standards: Declaration of syntax_plugin_code::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/code/syntax.php on line 41

Strict Standards: Declaration of syntax_plugin_tip::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/tip/syntax.php on line 38

Datum: Letztes Update Artikel & CP

RT um das Datum des letzten angelegten/geänderten Artikels oder ContentParts der gesamten Seite anzuzeigen.

Im Script kann eingestellt werden, ob die Artikel/CPs in versteckten Kategorien mit einbezogen werden sollen.
Artikel die innerhalb benutzerspezifischen/geschützten Kategorien liegen werden nicht berücksichtigt.

Die Ausgabe kann nach den üblichen php-Datumregeln gestaltet werden. Z.B. {DATE_UPDATE:d.m.Y H:i} liefert 01.02.2010 12:23
oder im Script wird auf die Formatierung wie in conf.template.default.inc.php vorgegeben umgeschaltet. Der TAG dazu: {DATE_UPDATE}.
(Am Ende des Scripts die Zeilen entkommentieren).

Ähnliche Funktion siehe: NEWX



rt_date_last_update V1.0 22.04.2011

Docu: –
Forum: http://forum.phpwcms.org/viewtopic.php?f=16&t=21358

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

Update 25.04.2011:

  • Korrektur für Datenbanken die im SELECT keine Unterabfragen unterstützen. (Dadurch entfällt die Möglichkeit auch andere Spalten aus der Artikeltabelle auszulesen z.B. die ID des betreffenden Artikels. Für unseren Anwendungsfall ist dies jedoch unwichtig).
  • Korrektur: Spezialfall wenn Artikel/CPs in “Home” ID=0 angelegt/editiert wurden.

TAG: {DATE_UPDATE} oder z.B. {DATE_UPDATE:d.m.Y H:i}

Dateiname: rt_date_last_update.php

Verzeichnis: template/inc_script/frontend_render/

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

  • $phpwcms['allow_ext_render'] = 1;



Beschreibung:

Einstellungen der Variablen $show_hidden: [0|1|2]

  • Suche nach Artikeldatum in
  • - [0] nicht versteckten Kategorien
  • - [1] ausschließlich versteckten Kategorien
  • - [2] allen Kategorien


Der TAG {DATE_UPDATE} - auskommentierte Zeilen am Ende des Scripts:

Eine dieser Zeilen kann entkommentiert werden um {DATE_UPDATE} zu aktivieren.
Die Ausgabeeinstellungen des Datums beziehen sich in diesem Fall auf die Variablen in der Datei
“config/phpwcms/conf.template.default.inc.php”.

  • $template_default['date']['long']
  • $template_default['date']['medium']
  • $template_default['date']['short']

Die vierte Zeile sieht die Ausgabeeinstellungen des Datums direkt im Script vor.


Script:

Dateiname: rt_date_last_update.php
Verzeichnis: template/inc_script/frontend_render/

rt_date_last_update

<?php
/**
 *********************************************************************************************
 * The most recent Article date of the entire page (Article and CP)
 * 2011/04/22 V1.0  Knut Heermann (flip-flop) http://planmatrix.de
 * Update 2011/04/22 V1.0: MySQL Engines that also support subqueries in SELECT statement
 *                         Special case article in "home"
 *
 * Settings: @show_hidden: [0|1|2]
 * Search for article date in
 *  - [0] not hidden categories
 *  - [1] only hidden categories
 *  - [2] all categories
 *
 * TAG:    E.g. {DATE_UPDATE:d.m.Y H:i} or optional {DATE_UPDATE}
 *
 * Output: Optional settings from "conf.template.default.inc.php". Have a look to
 *         $template_default["date"]["language"] and
 *         $template_default["date"]["long"/medium/short]
 *         - Enable/disable at the end of the script
 *         - or manual in script
 *
 *********************************************************************************************
 */
 
// -------------------------------------------------------------------------------------------
// obligate check for phpwcms constants
  if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");}
// -------------------------------------------------------------------------------------------
 
 
if( ! (strpos($content["all"],'{DATE_UPDATE')===false)) {
 
    // category: "hide" or "visible when active"
    // --------------------------------------------
    $show_hidden = 2;  // [0] = not hidden categories  [1] = only hidden categories   [2] = all categories
    // --------------------------------------------
 
    $result = array();
 
    $sql  =    "SELECT UNIX_TIMESTAMP(max(article_tstamp)) AS max_article_tstamp ";
    // Nur fuer MySQL Engines geeignet die auch im SELECT Unterabfragen unterstuetzen
    // Only suitable for MySQL Engines that also support subqueries in SELECT statement
/*
    $sql .= ",article_id, ";
    $sql .= "article_begin AS article_livedate, ";
    $sql .= "article_end AS article_killdate ";
*/
    $sql .=    "FROM ".DB_PREPEND."phpwcms_article ar LEFT JOIN ".DB_PREPEND."phpwcms_articlecat ac ON ";
    $sql .=    "ar.article_cid = ac.acat_id WHERE ";
 
    // Categorie settings -------------
    $sql .= "ac.acat_aktiv=1 AND ac.acat_public=1 AND ac.acat_trash=0 AND ";
 
    // category: "hide" or "visible when active"
    switch ($show_hidden) {
        case 0: $sql .= "ac.acat_hidden=0 AND ";        // "hide" or "visible when active"
                break;
        case 1: $sql .= "ac.acat_hidden>=1 AND ";        // "hide" or "visible when active"
                break;
        default: $sql .= "";                            // all categories
 
    }
    $sql .= "ac.acat_regonly=0 AND ";                    // "visible for users logged on only"
    // Article settings ---------------
    $sql .= "ar.article_public=1 AND ar.article_aktiv=1 AND ";
 
    // Article settings
    $sql .= "ar.article_deleted=0 AND ar.article_begin<NOW() ";
    $sql .= "AND IF(ac.acat_archive=1 AND ar.article_archive_status=1, 1, ar.article_end>NOW()) LIMIT 1 ";
 
    $result = _dbQuery($sql);
 
 
    // ------------------ Special case article in "home"
    // Category settings in: $content["struct"]['0']
 
    // catch the articles in "home" ID =0
    $sql  = "SELECT UNIX_TIMESTAMP(max(article_tstamp)) AS max_article_tstamp ";
    $sql .= "FROM ".DB_PREPEND."phpwcms_article WHERE ";
    $sql .= "article_cid=0 AND ";
    $sql .= "article_public=1 AND article_aktiv=1 AND ";
    $sql .= "article_deleted=0 AND article_begin<NOW() AND ";
    // Category settings from "home"
    if ($content["struct"]['0']['acat_permit']['acat_archive'] == 1)
         $sql .= "IF(article_archive_status=1, 1, article_end>NOW()) ";
    else
        $sql .= "article_end>NOW() ";
    $sql .= "LIMIT 1 ";
 
    $result0 = _dbQuery($sql);
 
    // Article in "Home" the youngest one?
    if (isset($result0['0']['max_article_tstamp']) AND ($result0['0']['max_article_tstamp'] > $result['0']['max_article_tstamp']) )
        $result['0']['max_article_tstamp'] = $result0['0']['max_article_tstamp'];
    // ------------------
 
    $my_date = (isset($result['0']['max_article_tstamp'])) ? $result['0']['max_article_tstamp']: time();
 
 
    // Enable / disable the output form
    // Optional settings from "conf.template.default.inc.php". Have a look to
    // $template_default["date"]["language"] and
    // $template_default["date"]["long"/medium/short]
    // ------------------------------------------------
//    $content["all"] = str_replace('{DATE_UPDATE}', international_date_format($template_default["date"]["language"], $template_default["date"]["long"],   $my_date),   $content["all"]);
//    $content["all"] = str_replace('{DATE_UPDATE}', international_date_format($template_default["date"]["language"], $template_default["date"]["medium"], $my_date),   $content["all"]);
//    $content["all"] = str_replace('{DATE_UPDATE}', international_date_format($template_default["date"]["language"], $template_default["date"]["short"],  $my_date),   $content["all"]);
//    $content["all"] = str_replace('{DATE_UPDATE}', international_date_format($template_default["date"]["language"], 'd.m.Y H:i',                         $my_date),   $content["all"]);
 
    $content["all"] = render_date($content["all"], $my_date, 'DATE_UPDATE');
 
}
 
?>


deutsch/ersetzer_rts/frontend_render/datum-letztes-update.txt · Last modified: 2011/04/25 17:12 by Knut Heermann (flip-flop)
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

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 79