<?php
///Класс для вывода шапки и футера
class body{				
///Переменные по умолчанию
	private $title = 'Интересные блоги &mdash; Riblog.ru';
	private $description = 'Интересные статьи и файлы по IT-тематике Riblog.ru.';
	private $keywords = 'Риблог, статьи, блоги, ИТ, информационные технологии, riblog, riblog.ru, IT';
///Задаем титл
	public function SetTitle($param) {
	   return $this->title=$param;	
	}
///Задаем дискр
	public function SetDescription($param) {
	   return $this->description=$param;	
	}	
///Задаем ключевые слова
	public function SetKeywords($param) {
	   return $this->keywords=$param;	
	}
///Задаем шапку	
	public function GetHeader($bodys = NULL) {
        global $user;
        ?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="<?php echo $this->description;?>"/>
<meta name="keywords" content="<?php echo $this->keywords;?>"/>
<link rel="stylesheet" href="/css/font/css/all.min.css">
<?php if(isset($_GET['page'])): ?>
<link rel="canonical" href="https://riblog.ru" />
<?php else: ?>
<link rel="canonical" href="https://riblog.ru<?php echo $_SERVER['REQUEST_URI'];?>" />
<?php endif;?>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Rubik:300|Roboto:300">
<link rel="stylesheet" href="/css/app.css?id=243">
<link rel="shortcut icon" type="image/x-icon" href="/css/favicon.ico"/>
<title><?php echo $this->title;?> - Riblog.ru</title>
            </head>
            <body>
                <div class="container">
                	<div class="row">
                		<div class="col-3" id="lefts">
		                    <div class="headis">
                                <a href="/" class="logos jm-logo" title="перейти на главную">RIBLOG</a>
		                    </div>
		                </div>
	                 	<div class="col">
	                 		<div class="headis">
                                <div class="search_box">
                                        <input type="text" name="search" id="search" class="searcad2a" placeholder="Поиск">         
                                    </form>
                                    <div id="search_box-result" class="searcad1 searcad2a"></div>
                                </div>
                                <?php if(isset($user['id'])): ?>
                                    <div onclick="gomenu();" class="logosr">
                                        <span class="nickl" style="text-transform: lowercase;color: #b2bfff;"><?php echo $user['first_name'];?></span> <span class="donwl"><i class="fas fa-chevron-down"></i></span>
                                    </div>
                                    <div class="gomenu" id="gomenu" style="display: none;">
                                        <?php if(isset($user['id'])): 
                                            if($user['lvl'] > 2): ?> 
                                                <a class="fffz" href="/my/addtext/"><i class="fas fa-plus-square"></i> Создать блог</a>
                                                <a class="fffz" href="/my/myblog/"><i class="fas fa-heading"></i> Мои блоги</a>
                                                <a class="fffz" href="/my/fotos/"><i class="fas fa-camera"></i> Мои фото</a>
                                                <div class="gomenu_r"></div>
                                                <a class="fffz" href="/my/settss/"><i class="fas fa-cog"></i> Настройки</a>
                                                <div class="gomenu_r"></div>
                                            <?php endif; 
                                            if($user['lvl'] == 100):?>
                                                <a class="fffz" href="/moder/">На модерации</a>
                                                <a class="fffz" href="/admins/">Админка</a>
                                                <div class="gomenu_r"></div>
                                        <?php endif;
                                        endif; ?>
                                        <a class="fffz" href="/exit/"><i class="fas fa-sign-out-alt"></i> Выход</a>
                                    </div>
                                <?php else: ?>
                                    <div onclick="gomenu();" class="logosr">
                                       	<span class="nickl" style="text-transform: lowercase;color: #e8eff7;">Войти</span>
                                    </div>
                                    <div class="gomenu" id="gomenu" style="display: none;">
                                        <script src="//ulogin.ru/js/ulogin.js"></script>
                                        <div id="uLogin" style="margin-top: 8px;" data-ulogin="display=panel;theme=flat;fields=first_name,last_name,network,uid,photo;providers=odnoklassniki,facebook,vkontakte,mailru,google,yandex;redirect_uri=https://riblog.ru/login/?add;mobilebuttons=0;"></div>
                                    </div>
                                <?php endif; ?>
                            		<div onclick="usonl();" class="logosr">
                                       	<span class="nickl" style="text-transform: lowercase;color: #e8eff7;">Люди</span> <span class="donwl"><i class="fas fa-chevron-down"></i></span>
                                    </div>
									<div id="onliuses2" class="linskso2" style="display: none;">
									</div>
                                    <a href="/online/" class="logosr" style="text-transform: lowercase;color: #e8eff7;">
                                        <span class="nickl">Помощь</span>
                                    </a>
                            </div>
	                 	</div>
	                </div>
	            </div>
                <div class="container">
                	<div class="row">
                		<div class="col-3" id="lefts">
                            <nav>
                                <?php $sql = DB::$dbs->query("SELECT `id`,`name`,`urlt`,`url` FROM `razd` ORDER BY `id` DESC LIMIT 10")->fetchAll(PDO::FETCH_BOTH);
                                foreach ($sql as $vivd): ?>
                                    <div class="nave1b"><span class="razderlf"><?php echo $vivd['name'];?></span> <div class="leftcou"><?php echo DB::$dbs->querySingle('SELECT COUNT(id) FROM `blog` WHERE `razdel` = ?',[$vivd['id']]);?></div></div>
                                        <?php $sql1 = DB::$dbs->query("SELECT `id`,`name`,`urlt`,`magic`,`color` FROM `podrazd` WHERE `razdel` = ? ORDER BY `id` ASC LIMIT 10",[$vivd['id']])->fetchAll(PDO::FETCH_BOTH);
                                        foreach ($sql1 as $vivd1): ?>
                                            <a class="nave2b" href="/podrazdel/<?php echo $vivd1['urlt'];?>/"><?php echo $vivd1['magic'];?> <?php echo $vivd1['name'];?> <div class="leftcou"><?php echo functions::nonull(DB::$dbs->querySingle('SELECT COUNT(id) FROM `blog` WHERE `podrazdel` = ?',[$vivd1['id']]));?></div></a>
                                        <?php endforeach; ?>
                                <?php endforeach; ?>
                            </nav>    
                        </div>
                        <?php
                        /*
                        <div class="titlel">Категории</div>
                            <nav>
                                <?php $sql = DB::$dbs->query("SELECT `id`,`name`,`urlt`,`url` FROM `razd` ORDER BY `id` DESC LIMIT 10")->fetchAll(PDO::FETCH_BOTH);
                                foreach ($sql as $vivd): ?>
                                    <div class="linkr3" style="cursor: pointer;" id="razdel_<?php echo $vivd['id'];?>" onclick="razdell(<?php echo $vivd['id'];?>);"><i class="fad fa-caret-right"></i> <?php echo $vivd['name'];?> <div class="leftcou"><?php echo DB::$dbs->querySingle('SELECT COUNT(id) FROM `blog` WHERE `razdel` = ?',[$vivd['id']]);?></div></div> 
                                    <div style="display: none;" class="rasdp" id="podr_<?php echo $vivd['id'];?>">
                                        <?php $sql1 = DB::$dbs->query("SELECT `id`,`name`,`urlt` FROM `podrazd` WHERE `razdel` = ? ORDER BY `id` ASC LIMIT 10",[$vivd['id']])->fetchAll(PDO::FETCH_BOTH);
                                        foreach ($sql1 as $vivd1): ?>
                                            <a href="/podrazdel/<?php echo $vivd1['urlt'];?>/" class="podrazd"><?php echo $vivd1['name'];?><div class="leftcou" style="color:#93919a;"><?php echo functions::nonull(DB::$dbs->querySingle('SELECT COUNT(id) FROM `blog` WHERE `podrazdel` = ?',[$vivd1['id']]));?></div></a>
                                        <?php endforeach; ?>
                                    </div>
                                <?php endforeach; ?>
                            </nav>
                        */
                        ?>
                        <div class="col" style="border-bottom: 3px solid #55779b;">
                            <div class="flowap2">
        <?php
        // Вывод ошибок
        if (isset($_SESSION['err'])):
            ?>
            <div id="error">
                <a id="close" title="Закрыть" href="#" onclick="document.getElementById('error').setAttribute('style','display: none;');"><i class="fas fa-times"></i></a> <?php echo $_SESSION['err'];?>
            </div>
            <?php
            $_SESSION['err'] = NULL;
        elseif (isset($_SESSION['good'])):
            ?>
            <div id="good">
                <a id="close" title="Закрыть" href="#" onclick="document.getElementById('good').setAttribute('style','display: none;');"><i class="fas fa-times"></i></a> <?php echo $_SESSION['good'];?>
            </div>
            <?php
            $_SESSION['good'] = NULL;
        endif;
	}
///Задаем ноги				
	public function GetFooter() {
        global $generrat;
        ?>
    	    		</div>
        		</div>
        		<script src="/css/jquery2.min.js"></script>
        		<script src="/css/js.js?id=68"></script>
                <!-- Yandex.Metrika counter -->
                <script type="text/javascript" >
                   (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
                   m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
                   (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");

                   ym(56503468, "init", {
                        clickmap:true,
                        trackLinks:true,
                        accurateTrackBounce:true
                   });
                </script>
                <noscript><div><img src="https://mc.yandex.ru/watch/56503468" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
                <!-- /Yandex.Metrika counter -->







            </body>
        </html>
        <?php
        /*<script src="/css/js.js?id=12"></script>

		        <div class="foots">
		            <div style="line-height: 17px;font-size: 16px;padding-top: 6px;">
		                <span style="color: #ec9b9b;font-weight: 700;">©RiBlog.Ru</span><br/>
		                2017 - 2020
		            </div>
		        </div>
            <div style="text-align: center;opacity: .3;margin-top: 5px;">
<a href="//statok.net/go/19896"><img src="//statok.net/imageOther/19896" alt="*" /></a>
<a href="http://dinotop.ru/go/290"><img src="//dinotop.ru/imageOther/290" alt="*" /></a>
<!--LiveInternet counter--><script type="text/javascript">
document.write('<a href="//www.liveinternet.ru/click" '+
'target="_blank"><img src="//counter.yadro.ru/hit?t26.6;r'+
escape(document.referrer)+((typeof(screen)=='undefined')?'':
';s'+screen.width+'*'+screen.height+'*'+(screen.colorDepth?
screen.colorDepth:screen.pixelDepth))+';u'+escape(document.URL)+
';h'+escape(document.title.substring(0,150))+';'+Math.random()+
'" alt="" title="LiveInternet: показано число посетителей за'+
' сегодня" '+
'border="0" width="88" height="15"><\/a>')
</script><!--/LiveInternet-->
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
   (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
   m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
   (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");

   ym(56503468, "init", {
        clickmap:true,
        trackLinks:true,
        accurateTrackBounce:true
   });
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/56503468" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
        */
    }
}
?>