Вход Регистрация
Файл: __core/helpers.php
Строк: 32
<?php
function head($headers = array()) {
    
ob_start();
    
?>
    <!DOCTYPE html>
    <html>
    <head>
       <title><?= $headers['title'] ?></title>
       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
       <link rel="stylesheet" href="/style/main.css" type="text/css"/>
       <link rel="stylesheet" href="/style/jquery.lightbox-0.5.css" type="text/css"/>
    </head>
    <body>
    <div class="wrapper">
    <div class="header">
        <div class="logo">Portfolio</div>
    </div>
    
    <?php
}

function 
footer() {
    global 
$time;
    
?>
    <div class="footer">
    <?php
    
list($msec, $sec) = explode(chr(32), microtime());
    echo 
'[' . round(($sec + $msec) - $time, 4).'сек.]';
    
?>
    </div>
</div>
<script src="/js/jquery-1.10.1.min.js"></script>
<script src="/js/lightbox/jquery.lightbox-0.5.min.js"></script>
<script>
$(function() {
    $('#thumbnails a').lightBox();
});
</script>
</body>
</html>
<?php    
}

function 
get_msg() {

    if (isset(
$_SESSION['msg'])) {
        
?>
        <div class="msg"><?= $_SESSION['msg'] ?></div>
        <?php
        
unset($_SESSION['msg']);        
    }
    
    if (isset(
$_SESSION['err'])) {
        
?>
        <div class="err"><?= $_SESSION['err'] ?></div>
        <?php
        
unset($_SESSION['err']);        
    }

}

/*
 * Форматируем строку с размеров файла
 */
function formatSize($size) {
    
$units = array(' Б', ' Кб', ' Мб', ' Гб', ' Тб');
    for (
$i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;
    return 
round($size, 2).$units[$i];
}

function 
ratingGet($key) {
    
    
$data = array('еденицу', 'двоечку', 'троечку', 'четверочку', 'пятерочку');
    
    return 
'Оценил(а) на <b>' . $data[$key] . '</b>';
    
}
Онлайн: 1
Реклама