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
CP-Kommentarausgabe [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

CP-Kommentarausgabe

Unterstützt die Ausgabe des CP Kommentarfeldes mit Hilfe eines TAG im Text oder einer Vorlage.
TAG: → {CPCOMMENT}

Beschreibung:

Wird der TAG {CPCOMMENT} im CP Text oder in einer Vorlage gesetzt, so wird an dieser Stelle der Inhalt des zugehörigen Kommentarfelds ausgegeben.

Die Klasse <span="cpcomment"> .... </span> wurde als Umschließer für die Kommentausgabe gesetzt.

Zusätzlich kann bestimmt werden, in welchen CP's nach dem TAG gesucht wird. (IF statement …)

  1. Filtern nach Content Part Typen
  2. Filtern nach Kategorie ID´s
  3. Filtern nach Artikel ID´s
  4. Filtern nach CP ID´s
  5. Oder verwende eine Kombination aus den oben gezeigten Abfragen.

Wird das einführende IF-Statement mit seiner schließenden Klammer auskommentiert, werden alle CPs untersucht. (Geschwindigkeit!!)



Docu: –
Forum: –

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

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

  • $phpwcms['allow_ext_init'] = 1;



PHP:

Datei: /template/inc_script/frontend_init/cp_trig_comment_output.php

cp_trig_comment_output.php

<?php
// -------------------------------------------------------------------------------------------
// obligate check for phpwcms constants
  if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day."); }
// -------------------------------------------------------------------------------------------
//
// 20.02.11 KH (flip-flop) Out of the comment field by TAG {CPCOMMENT}
// -------------------------------------------------------------------------------------------
 
 
   function CP_Comment_field_Output($text, & $data) {
 
      // CP filter in use:
      // - Please enhance the array for your needs, have a look into
      // - http://www.phpwcms-howto.de/wiki/doku.php/english/technics/internal-function-call/content-part-types
      // e.g. CPs: 0 => Plain Text, 6 => HTML, 15 => WYSIWYG, 29 => IMAGE <div>
      // If you don´t need a filter (all CPs will be processed), please disable the if statement and the associated closing parenthesis
 
      // Second example for processing only cp´s are located in specific category
      // Third example for processing only cp´s are located in specific articles
      // Forth example for processing only cp´s with it´s unique cp id
 
 
 
      // 1) Filter by Content Part Types
//      if( in_array($data['acontent_type'], array(0,6,14,29)) ) { // is used only when the CP-filter is needed.
 
      // 2) Filter by category
//      if( in_array($GLOBALS["content"]["struct"][$GLOBALS["content"]["cat_id"]]["acat_id"], array(0,6,14,29)) ) { // is used only when the CP-filter is needed.
 
      // 3) Filter by unique article id´s
//      if( in_array($data['acontent_aid'], array(0,6,14,29)) ) { // is used only when the CP-filter is needed.
 
      // 4) Filter by unique cp id´s
      if( in_array($data['acontent_id'], array(10,6,14,29)) ) { // is used only when the CP-filter is needed.
 
        // Replaces the TAG and put a class around it.
        $text = str_replace("{CPCOMMENT}",       '<span class="cpcomment">'.$data['acontent_comment'].'</span>', $text);  // replace cp Comment
 
      } // Used only if a CP-filter is in use.
 
      // Delete all unused TAGs
      else
        $text = str_replace("{CPCOMMENT}",       '', $text);
 
 
      return $text;
   }
 
 
   register_cp_trigger('CP_Comment_field_Output');
?>


deutsch/ersetzer_rts/frontend_init/cp_trigger/cp-comment-output.txt · Last modified: 2011/02/21 17:36 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