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
Article move into archive [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

Article move into archive

Autom. move of expired article into a archive category

This script is working for one article list in one category and one archive category.

The ID of the source category (where the article list is) please register in $my_article_cat . The Target- or archive category (where the articles at expiration to be kept) please register in $my_archive_cat .

If the switch [x] archives is set in category and a visitor accesses the category where the article list is, the expired article is still indicated. At the same time it was shifted into archives. The script is only running if a user visits this category.

If you don´t like this behavior, please open the switch [ ] Archive in category. Thus the script runtime increases a little, since the database must be addressed immediately. With small sides (number of articles < 300) that is uncritical.

A navigation for terminated articles in archive are available: Article menu for archive

Condition:

  • Source category must be run in article list-mode: Site structure - categoriy –> top article count > 1
  • Articles in this category: edit article basis information –> [x](available after end date (archive))


Recommended:

  • Source category = archive [x] (faster processing)
  • Target category = archive [x]



rt_article_move_to_archive V1.0 26.07.09

Docu: –
Forum: –

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

Update

**27.12.09 KH**
$content['list_mode'] == true
changed to
$content['struct'][$content['cat_id']]['acat_topcount'] > 1

Tag: –

Fileiname: rt_article_move_to_archive.php

Folder: template/inc_script/frontend_render/

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

  • $phpwcms['allow_ext_render'] = 1;


rt_article_move_to_archive

<?php
/* *****************************************************************************
 Autom. Verschieben von abgelaufenen Artikeln in eine Archivkategorie
 autom. move of expired article into a archive category
 
 26.07.09 V1.0 Knut Heermann (flip-flop) http://planmatrix.de
 
 27.12.09 Update KH:
 $content['listmode'] == true
 changed to
 $content['struct'][$content['cat_id']]['acat_topcount'] > 1
 
 Bedingung // Condition:
 - Quell-Kategorie muss im Artikel-Listenmodus arbeiten "Anzahl an Top-Artikeln > 1"
 - // Source category must be run in article list-mode "top article count > 1"
 - Artikel in dieser Kategorie "[x](verfuegbar nach Enddatum (archivieren))"
 - // Articles in this category "[x](available after end date (archive))"
 
 
 Empfohlen // Recommended:
 Quellkategorie // Source category = Archiv [x]  (Schnellere Abarbeitung // faster processing)
 Zielkategorie  // Target category = Archiv [x]
 
***************************************************************************** */
 
// -----------------------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) { die("You Cannot Access This Script Directly, Have a Nice Day."); }
// -----------------------------------------------------------------------------
 
 
// USERINPUT ======================================================
 
// Kategorie-ID in der das Artikel-Listing laeuft   (Quelle)
// Category-ID where the article listing is running (source)
$my_article_cat = 4;
 
// ID der Archiv-Kategorie in die verschoben werden soll (Ziel)
// ID of the archive category (target)
$my_archive_cat = 70;
 
// USERINPUT END ==================================================
 
 
 
// Nur ausfuehren wenn der Listenmodus in der Kategorie eingeschaltet und die angegebene Kategorie aktiv ist
// Only run if list mode in category is true and the specified category is active
// if( $content['list_mode'] == true && $content['cat_id'] == $my_article_cat) {
 
// Update 27.12.09 KH:
// Nur ausfuehren wenn in der Kategorie "Anzahl an Top-Artikeln:" > 1  und die angegebene Kategorie aktiv ist
// Only run if in category "top article count:" > 1  and the specified category is active
if( ($content['struct'][$content['cat_id']]['acat_topcount'] > 1) && ($content['cat_id'] == $my_article_cat) ) {
 
    $article = array();
 
    // Kategorie-Schalter [x] Archive gesetzt? (fuer schnellere Abarbeitung)
    // Category switch [x] archive set?        (for faster prcessing)
 
    if ( $content['struct'][$content['cat_id']]['acat_archive'] == 1 ) {
 
       $my_time = time(); // for faster processing
 
 
    // Gibt es einen Artikel bei dem das Datum abgelaufen ist?
    // Is there an article with expired date?
 
       foreach($content['articles'] as $key => $value) {
 
         if ($content['articles'][$key]['article_killdate'] < $my_time ) {
            $article[] = $value['article_id'];
         }
       }
 
      // Kategorie-Schalter [ ] Archive offen ? - etwas langsamere Verarbeitung
      // Category switch [x] archive unset?  - slow down prcessing a little bit
    } else
      {
        $article[0] = 0;  // Fuer Aktivierung sql-Update // for activating sql-update
      }
 
 
   // Wenn mindestens ein Artikel vorhanden ist
   // If minimum one article exists
   if(count($article)) {
 
    $sql  = 'UPDATE '.DB_PREPEND.'phpwcms_article SET ';
    $sql .= "article_cid= ".$my_archive_cat." ";
    $sql .= "WHERE article_cid= ".$my_article_cat." AND article_archive_status=1 AND article_deleted=0 ";
    $sql .= " AND article_public=1 AND article_aktiv=1 AND article_end < NOW() ";
 
    $queryResult = _dbQuery($sql, 'UPDATE');
 
   }
}
 
?>


If you liked to have the version for several categories and archives, please donate or write wiki articles or translate some.

….. The IDs of the source categories (where the article list is) please register in the array $my_article_cat_id['source']. The Target- or archive categories (where the articles at expiration to be kept) please register in $my_article_cat_id['archive'].

These are registered as pairs into the two arrays, every source category with one target category.

 $my_article_cat_id['source']  = array( 4, 71, 90, 230)  article-listing-categories
                                        |   |   |   |
 $my_article_cat_id['archive'] = array(70, 72, 95, 150)  article-archive-categories 

….. An assignable number of years can be add and stored to the end-date, in order to be able to navigate in archives with the built-in function article menu. The number of years should be added registered into the variable $boost_year.
E.g. $boost_year = '10'; (for +10 years: 2009-05-07 20:34:00 –> 2019-05-07 20:34:00) ….

english/phpwcms_replacer_rts/frontend_render/article-move-into-archive.txt · Last modified: 2010/01/02 00:33 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