Last active
August 3, 2016 15:03
-
-
Save ANna90ser/17ebf176ad4b9889e2acdefd55016bf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ru"> | |
<?php | |
if ($Module == 'category' and $Param['id'] != 1 and $Param['id'] != 2 and $Param['id'] != 3 and $Param['id'] != 4 and $Param['id'] != 5 and $Param['id'] != 6 and $Param['id'] !=7 and $Param['id'] != 8 and $Param['id'] != 9 and $Param['id'] != 10) MessageSend(1, 'Такой категории не существует.', '/news'); | |
$Param['page']+=0; | |
Head ('Новости'); | |
?> | |
<body> | |
<?php Hiader () | |
?> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-3"> | |
<aside class="sidebar"> | |
<?php Sidebar () ?> | |
</aside> | |
</div><!--end-col-md-3--> | |
<div class="main-content"> | |
<div class="col-md-9"> | |
<div class="col-md-9"> | |
<div class="content__title"> | |
<?php if ($_SESSION['USER_LOGIN_IN']) echo '<a class="content__title-button" href="/news/add">Новости</a>' ?> | |
</div> | |
</div> | |
<div class="col-md-3"> | |
<div class="content__chat"> | |
<a href="/chat" class="content__chat-button">Чат</a> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-12"> | |
<?php MessageShow() | |
?> | |
<div class="page__news"> | |
<?php | |
if ($Page == 'my-news') { | |
if ($_SESSION['USER_GROUP'] !=2) $Active = 'WHERE `active`=1'; | |
$Param1 = 'SELECT `id`, `name`, `added`, `date`, `pay`, `active`, `dimg` FROM `news` '.$Active.' ORDER BY `id` DESC LIMIT 0, 10'; | |
$Param2 = 'SELECT `id`, `name`, `added`, `date`, `pay`, `active`, `dimg` FROM `news` '.$Active.' ORDER BY `id` DESC LIMIT START, 10'; | |
$Param3 = 'SELECT COUNT(`id`) FROM `news`'; | |
$Param4 = '/news/my-news/page/'; | |
} | |
$Count = mysqli_fetch_row(mysqli_query($CONNECT, $Param3)); | |
if (!$Param['page']) { | |
$Param['page'] = 1; | |
$Result = mysqli_query($CONNECT, $Param1); | |
} else { | |
$Start = ($Param['page'] - 1) * 10; | |
$Result = mysqli_query($CONNECT, str_replace('START', $Start, $Param2)); | |
} | |
PageSelector($Param4, $Param['page'], $Count); | |
while ($Row = mysqli_fetch_assoc($Result)) { | |
if (!$Row['active']) $Row['name'].='(Ожидает модерации)'; | |
else if ($_SESSION['USER_LOGIN']==$Row['added']) | |
echo '<a href="/news/material/id/'.$Row['id'].'"> | |
<p class="new-date"><time>Добавлено:'.$Row['date'].'</time></p></a>'; | |
} | |
?> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div><!--end-row--> | |
</div><!--end-container--> | |
<?php Foter() ?> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment