This is an old revision of the document!


Vorlage

Ausgabe der Infofeldes aus der Dateizentrale im CP Dateiliste

Forum: http://forum.phpwcms.org/viewtopic.php?p=115474#p115474

Bedingung:/config/phpwcms/conf.inc.php
$phpwcms['allow_cntPHP_rt'] = 1;

Um dies zu erreichen brauchen wir ein spezielles php Programm.

In die Vorlage nach

<!--FILE_ENTRY_START//--> 

bitte folgendes einsetzen:

snipped

<!--FILE_ENTRY_START//-->
 
[PHP]
   foreach($GLOBALS['content']['files_result'] as $_files_x => $value) {
      $_longinfo =  $value['f_name'] == '{FILE_NAME}' ? $value['f_longinfo'] : '';
      echo $_longinfo;
   }
 
//   dumpVar($GLOBALS['content']['files_result']);
[/PHP]


Mache auch einen Test mit

dumpVar($GLOBALS['content']['files_result']);

Alle Variablen werden anschaulich ausgegeben.


Empfohlen →> Seit der V1.4.2 r352: kann die folgende Zeile getauscht werden:

$_longinfo =  $value['f_name'] == '{FILE_NAME}' ? $value['f_longinfo'] : '';

gegen

$_longinfo =  $value['f_id'] == '{FILE_ID}' ? $value['f_longinfo'] : '';


Infofeld und Downloadschalter

Ausgabe des Infofeldes und Reaktion auf den Downloadschalter, Z.B. ausblenden der Anzeige mit <div style=“display: none;”>

snipped

<!--FILE_ENTRY_START//-->
[PHP]
   $_longinfo = '';
   $_download = true;
   foreach($GLOBALS['content']['files_result'] as $_files_x => $value) {
      if ( $value['f_id'] == '{FILE_ID}' ) {
          $_longinfo =  $value['f_longinfo'];
          $_download = ($value['f_gallerystatus'] == 1) ? true : false;
          break;
      }
   }
 
//   dumpVar($GLOBALS['content']['files_result']);
 
   echo ($_download) ? '<div style="display: all;">' : '<div style="display: none;">';
 
   echo $_longinfo;
   echo ' - Download switch ';
   echo ($_download) ? "[x]" : "[-]";
[/PHP]
 
  .........
  .........
  </div> <!--if download ... //-->
<!--FILE_ENTRY_END//-->
deutsch/phpwcms-system/artikel/contentparts/dateiliste/vorlage.1251465948.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