This is an old revision of the document!


SHOW_ARTICLE_CP

Tag: {SHOW_ARTICLE_CP} ↔ {SHOW_CP}

Forum: {SHOW_ARTICLE_CP} <-> {SHOW_CP}

Gibt die CPs der Artikel die sich in der aktiven Struktur befinden an der Stelle {SHOW_ARTICLE_CP} im Template aus. (Nur im Artikel Listen-Modus verfügbar). Wenn ein CP ausgegeben werden soll wird der Tag {SHOW_CP} in das CP Kommentarfeld eingefügt.

Der Tag {SHOW_ARTICLE_CP} legt fest, wo die CPs in der Vorlage angezeigt werden sollen.

Es werden nur die CPs der Artikel in der aktuellen Ebene ausgegeben.


- struktur level (Artikel im Listen-Modus)
--- 1. article .... Listen-Modus aber kein Schlagtext (summary)
------ CP Images .... (Z.B. Ausgabe an der rechten Seite) A{SHOW_CP}
--- 2. article .... Listen-Modus mit Schlagtext
------ CP Text .... (Ausgabe an der rechten Seite)        B{SHOW_CP}
------ CP Images .... (Ausgabe an der rechten Seite)      C{SHOW_CP}
------ CP Link list .....
--- 3. article .... Listen-Modus mit Schlagtext
------ CP Text/Bild ....


TAG: {SHOW_ARTICLE_CP} um den RT zu aktivieren und den Ort der Ausgabe in der Vorlage zu bestimmen.

TAG: [X]{SHOW_CP} im Kommentarfeld des anzuzeigenden CPs. Wobei [X] das Sortierkriterium ist, z.B. A{SHOW_CP} ….B{SHOW_CP} …. C{SHOW_CP} ….

<note tip> Platziere diesen Tag als ersten Eintrag in das Kommentarfeld wenn eine korrekte Sortierung verlangt wird ! </note>

Und → CP Status: [x] sichtbar (Oder ändere im Skript “acontent_visible” für die Darstellung unsichtbarer CPs).

Es wird autoamtisch ein Wrapper <div class=“show_article_cp”>OUTPUT</div> erzeugt.
Bitte lege die Klasse class .show_article_cp in einer eingebundenen CSS Datei an wenn benötigt.

Sinn: Wenn der Tag keine Ausgabe erzeugt (z.B. in einem anderen Strukturlevel) wird kein überflüssiger Quelltext erzeugt der u.U. die Formatierung der Seite sprengt.




Location: /template/inc_script/frontend_render/rt_show_article_cp.php

{SHOW_ARTICLE_CP} - {SHOW_CP}

<?php
// **************************************************************************
// 24.04.08 Show CP from an article in list mode (V 1.0)
// Knut Heermann (flip-flop) http://planmatrix.de
// 25.04.08 Edit by Oliver Georgi
// 26.04.08 KH: Output in only active site level doesn´t run
// 26.04.08 OG: Optimized source and add manual sorting e.g.
//              A{SHOW_CP} B{SHOW_CP} C{SHOW_CP} ....
//
// http://forum.phpwcms.org/viewtopic.php?p=102704#p102704
// http://forum.phpwcms.org/viewtopic.php?p=102798#p102798
//
// TAG:      {SHOW_ARTICLE_CP} for activating in your template
// TAG:      [X]{SHOW_CP} in the comment field of the displayed CP
//           Where [X] is the sort criterion e.g. A{SHOW_CP} B{SHOW_CP} ....
//           Places this tag first in comment field!!!
//
// Condition: CP status: [x] visible  (Or change "acontent_visible")
// Location: Put it into the file e.g.:
//           /template/inc_script/frontend_render/rt_show_article_cp.php
// Switch in conf.inc.php: $phpwcms['allow_ext_render']  = 1;
// **************************************************************************
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
   die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
 
// Nur ausfuehren wenn der Listenmodus eingeschaltet ist
// Only run if list mode is true
if( $content['list_mode'] == true && strpos($content["all"], '{SHOW_ARTICLE_CP}') !== false ) {
 
  $content["all"] = str_replace('{SHOW_ARTICLE_CP}','<div class="show_article_cp">'.my_article_count_cp().'</div>', $content["all"]);
 
} else {
 
   $content["all"] = str_replace('{SHOW_ARTICLE_CP}', '', $content["all"]);
 
}
 
function my_article_count_cp() {
 
  // Artikel der aktuellen Seitenebene holen
   // get current listed article IDs
   $article = array();
   foreach($GLOBALS['content']['articles'] as $value) {
      $article[] = $value['article_id'];
   }
 
   if(count($article)) {
 
      // Artikel in der DB suchen und CP-ID bereitstellen
      // Search for the article and make the CP-ID available
      $sql  = "SELECT acontent_id ";
      $sql .= "FROM ".DB_PREPEND."phpwcms_articlecontent ";
      $sql .= "WHERE acontent_visible=1 AND acontent_trash=0 ";
      $sql .= 'AND acontent_aid IN ('.implode(',', $article).') ';
      $sql .= "AND acontent_comment LIKE '%{SHOW_CP}%' ";
      $sql .= "ORDER BY acontent_comment"; //, article_aid, acontent_sorting
 
      $result = _dbQuery($sql);
 
      if(isset($result[0]['acontent_id'])) {  // Any result available?
 
 
         // CP-ID String fuer SHOW_CONTENT bereitstellen
         // Create CP-IDs string for SHOW_CONTENT
         $cp_my_id_str   = '';
 
         foreach($result as $value) {
            $cp_my_id_str .= ','.$value['acontent_id'];
         }
 
         // Ausgabe der betroffenen CPs mit SHOW_CONTENT
         // Make the encountered CPs available with SHOW_CONTENT
         return showSelectedContent('CP'.$cp_my_id_str);
      }
   }
   return '';
}
 
?>
deutsch/ersetzer_rts/frontend_render/show_article_cp.1248592330.txt.gz · Last modified: 2018/06/03 18:07 (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