Viewable only for admin

This is quite easy (by O.G., check http://forum.phpwcms.org/viewtopic.php?f=16&t=24425 german only):

Example by 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]
…

The code for the frontend renderer

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

Save it as /template/inc_script/frontend_render/only-for-admin.php

english/phpwcms_replacer_rts/frontend_render/only_viewable_for_admin.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