<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
/****************************************************
*
* @File: 		functions.php
* @Package:		GetSimple
* @Action:		UIkit theme for GetSimple CMS
*
*****************************************************/

/**
 * UIkit Author 
 <?php if (function_exists('get_page_author')) { ?>
	<div class="uk-margin-small"><span class="uk-text-muted">Автор:</span> <em><?php get_page_author(); ?></em></div>
 <?php } ?>
 */
if(!function_exists('get_page_author')) {
    function get_page_author($echo=true) {
      global $GSNAME, $data_index;
      if (!$GSNAME) {
      $author = (string)$data_index->author;
      if (file_exists(GSUSERSPATH.$author.'.xml')) {
        $userxml = getXML(GSUSERSPATH.$author.'.xml');
        $GSNAME = !empty($userxml->NAME) ? htmlspecialchars($userxml->NAME) : $author;
      } else {
        $GSNAME = $author;
      }
    }
    if ($echo)
      echo $GSNAME;
    else
      return $GSNAME;
    }
}