View file storis-wmzo_ru/ifir/index.php

File size: 4.53Kb
<? 
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
// Заголовок 
$set['title'] = 'Все сторис';
include_once '../sys/inc/thead.php';
title(); aut(); 

// Оформление 
?><style>
    .image {
	position	: relative;
	width		: 100%; 
    }
    .ima {
    width: 100%;
    height: 150px;
    filter: blur(0.9px);
    }
    h3 {
          opacity: 0.8;
    color: #fffefe;
    letter-spacing: -1px;
    padding: 10px;
    position: absolute;
    top: 0px;
    right: 3%;
    border-radius: 9px;
    margin-left: 2px;
        width: 50%;
        text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    }
    h2 {
          opacity: 0.8;
    color: white;
    letter-spacing: -1px;
    padding: 10px;
    position: absolute;
    top: 50px;
    left: 0;
        width: 90%;
    border-radius: 9px;
    margin-left: 5px;
        text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    }
    .icon3 {
    background: #00000069;
    padding: 8px 15px 8px 15px;
    color: #fffdfd;
    margin: 0 8px 0 0;
    border-radius: 8px;
    float: right;
    margin-top: -40px;
    position: relative;
    }
    .icon5 {
    background: #00000069;
    padding: 8px 15px 8px 15px;
    color: #fffdfd;
    margin: 0 8px 0 0;
    border-radius: 8px;
    float: right;
        right: 50%;
    margin-top: -40px;
    position: relative;
    }
    .icon3 a {
    color: white;
    }
  .icon4 {
    background: #00000069;
    padding: 8px 15px 8px 15px;
    color: #fffdfd;
    margin: 0 8px 0 0;
    border-radius: 8px;
    float: left;
    margin-top: -40px;
    position: relative;
    margin-left: 10px;
    }
</style>






<?

if (isset($user)){
echo '<a style="margin-bottom: 10px; text-align: center; border-radius: 8px;" class="link" href="create"><span class="icon"><i class="far fa-edit"></i></span> Новая сторис</a>';
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `ifir` "),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$order='order by `time` desc';
$q=mysql_query("SELECT * FROM `ifir` $order LIMIT $start, $set[p_str]");

echo "<table class='post'>\n";

if ($k_post==0){
echo '<div class="menu">Нет записей</div>';
}
// название сторис

while ($post = mysql_fetch_assoc($q)){
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[author] LIMIT 1"));
// название сторис
$name = $post['name'];
// описание сторис
$opis = $post['opis'];
// название сторис
$colorname = $post['colorname'];
// описание сторис
$coloropis = $post['coloropis'];

echo '<table style="margin-bottom: -25px;border-radius:4px;" class="mess">';
echo '<td class="block_avatar">';
echo ''.avatar($post['author']).'</a><span class="avatar_icon">'.online($post['author']).'</span>';
echo '</td>';
echo '<td class="block_content">';
echo ''.user::nick($post['author']).'';
echo "<div class='time2'>Добавлено ".vremja($post['time'])."</div>";
echo '</td>';
echo '</table>';
echo '<div class="menu">';echo " <a href='stories?id=".$post['id']."'>";
echo '<div class="image"><img src="img/'.$post['id'].'.png" class="ima" >';
echo '<h3 style="background: #'.$colorname.';">' . output_text($name) , '</h3>';
echo '<h2 style="background: #'.$coloropis.';">' . output_text($opis) , '</h2></div>';

echo "<span class='icon4'><i class='far fa-eye'></i> ".$post['count']."</span>";
echo '<span style="float:right;">';
echo "<span class='icon3'><i class='fas fa-comment-alt'></i> ".mysql_result(mysql_query("SELECT COUNT(`id`)FROM `ifir_komm` WHERE `id_ifir`='$post[id]'"),0)."</span> ";
$l1=mysql_result(mysql_query("SELECT COUNT(*) FROM `ifir_like` WHERE `like` = '0' AND `id_ifir` = '".$post['id']."' LIMIT 1"),0);
$l2=mysql_result(mysql_query("SELECT COUNT(*) FROM `ifir_like` WHERE `like` = '1' AND `id_ifir` = '".$post['id']."' LIMIT 1"),0);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ifir_like` WHERE `id_user` = '".$user['id']."' AND `id_ifir` = '".$ifir['id']."' LIMIT 1"),0)==0)
echo "<span class='icon5'><i class='fas fa-heart'></i>  ".($l2-$l1)."</span>";
echo '</a> </div>';


}

echo "</table>\n";


if ($k_page>1)str('?'.$dop.'',$k_page,$page); // Вывод страниц





include_once '../sys/inc/tfoot.php';

?>