Difference between revisions of "How to make part of theme visible only to administrators"

From JReviews Documentation
Jump to: navigation, search
Line 1: Line 1:
 
Use this code:
 
Use this code:
 +
 +
'''JReviews 2'''
  
 
<source lang="php">
 
<source lang="php">
Line 7: Line 9:
 
</source>
 
</source>
  
 +
'''JReviews 3'''
  
 +
<source lang="php">
 +
<?php if($this->auth->admin):?>
 +
  // Everything here will be available only to admins
 +
<?php endif;?>
 +
</source>
  
 
[[Category:JReviews]]
 
[[Category:JReviews]]
 
[[Category:Themes]]
 
[[Category:Themes]]
 
[[Category:Users]]
 
[[Category:Users]]

Revision as of 14:28, 10 March 2018

Use this code:

JReviews 2

<?php if($this->Access->isAdmin()):?>
   // Everything here will be available only to admins
<?php endif;?>

JReviews 3

<?php if($this->auth->admin):?>
   // Everything here will be available only to admins
<?php endif;?>