Wenn nur der ADMIN einen Inhalt sehen darf

Das ist ganz einfach (von O.G., siehe http://forum.phpwcms.org/viewtopic.php?f=16&t=24425):

Beispiel im Template file list

<!--FILE_ENTRY_START//-->
   <div class="fileEntry" style="margin-bottom:10px; padding-bottom: 10px; border-bottom: 1px dotted #CCCCCC;" id="file-{FILE_ID}">
      <h2>
         [FILE_IMAGE_ELSE]<img src="{FILE_ICON}" alt="" border="0" />[/FILE_IMAGE_ELSE]
         [FILE_IMAGE]<img src="{FILE_IMAGE}" alt="" border="" />[/FILE_IMAGE]
         <a href="{FILE_LINK}&amp;target=0"{FILE_TARGET}>[FILE_TITLE]{FILE_TITLE}[/FILE_TITLE][FILE_TITLE_ELSE]{FILE_NAME}[/FILE_TITLE_ELSE]</a>
      </h2>
      [FILE_DESCRIPTION]<p>
      {FILE_DESCRIPTION}<br />[FILE_COPYRIGHT]
      Copyright: {FILE_COPYRIGHT}<br />[/FILE_COPYRIGHT]
      {FILE_EXT}, {FILE_SIZE}[IS_ADMIN], {FILE_DATE}[/IS_ADMIN]
      </p>[/FILE_DESCRIPTION][FILE_LONGINFO]
…

Der Code für den frontend renderer

<?php
$content['all'] = render_cnt_template($content['all'], 'IS_ADMIN', !empty($_SESSION['wcs_user_admin']) && $_SESSION['wcs_user_admin'] === 1 ? ' ' : '');
?>

Abspeichern unter /template/inc_script/frontend_render/only-for-admin.php

deutsch/ersetzer_rts/frontend_render/nur_der_admin_sieht_es.txt · Last modified: 2018/06/03 18:09 (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