Вход Регистрация
Файл: modules/diary/inc/user.php
Строк: 81
<?php

/* Мод "Блоги"
 * Версия v0.0.3
 * Дата последнего редактирования 22.04.2015
 * Двиг DCMS Special
 * Модифицировал densnet
 * Автор неизвестно
 * Файл user.php
 * Описание: блоги пользователя
 */

if (isset($_GET['sort']) && $_GET['sort'] == 1) {
    
$rating 1;
}
if (
$ank['diary_desc'] != NULL) {
    echo 
"<div class='foot'>" text::toOutput($ank['diary_desc']) . "</div>n";
}

if (isset(
$user) && $user['id'] == $ank['id']) {
    echo 
"<div class = 'comm'>";
    echo 
"<a href = '/modules/diary/create'>" img('komms.png''') . " Написать в блог</a> ";
    echo 
"</div>";
}
$where NULL;

if (!isset(
$umodd) && $ank['id'] != $user['id']) {
    
$q mysql_query("SELECT * FROM `diary` WHERE `id_user` = '$ank[id]' ORDER BY `" . (isset($rating) ? 'rating` DESC, `time' 'time') . "` DESC");
    while (
$post mysql_fetch_assoc($q)) {
        if (
$post['access'] == 'all' || $post['access'] == 'friends' && mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE (`user` = '$user[id]' AND `friends` = '$ank[id]') OR (`user` = '$ank[id]' AND `friends` = '$user[id]')"), 0) != || $post['access'] == 'pass' || $post['access'] == 'auth' && isset($user)) {
            
$where $where " " . ($where == NULL "AND (" "OR ") . "`id` = '$post[id]'";
        }
    }
    if (
$where != NULL) {
        
$where $where ")";
    }
}

$k_post mysql_result(mysql_query("SELECT COUNT(*) FROM `diary` WHERE `id_user` = '$ank[id]' AND `sk` = '0'$where"), 0);
$k_page k_page($k_post$set['p_str']);
$page page($k_page);
$start $set['p_str'] * $page $set['p_str'];

echo 
'<div class="busi_switcher' . ($k_post == ' brd-bt' NULL) . '">';
echo 
'<table width="100%"><tr><td>';
echo (!isset(
$rating) ? "<span class='active_item brd_l'>" "<a href='?p=blogs/user&amp;id=" $ank['id'] . "&amp;sort=0' class='brd_l'>") . "Все записи" . (!isset($rating) ? "</span>" "</a>");
echo 
'</td><td>';
echo (isset(
$rating) ? "<span class='active_item brd_r'>" "<a href='?p=blogs/user&amp;id=" $ank['id'] . "&amp;sort=1' class='brd_r'>") . "Лучшие" . (isset($rating) ? "</span>" "</a>");
echo 
'</td></tr></table></div>';

if (
$k_post == 0) {
    echo 
"<div class = 'errs'>";
    echo 
img('error.png''16') . " Нет результатов";
    echo 
"</div>";
}
if (
$k_post 0) {
    
$q mysql_query("SELECT * FROM `diary` WHERE `id_user` = '$ank[id]' AND `sk` = '0'$where ORDER BY `" . (isset($rating) ? 'rating` DESC, `time' 'time') . "` DESC LIMIT $start$set[p_str]");
}
$lq mysql_fetch_array(mysql_query("SELECT * FROM `diary` WHERE `id_user` = '$ank[id]' AND `sk` = '0'$where ORDER BY `" . (isset($rating) ? 'rating` ASC, `time' 'time') . "` ASC LIMIT $start, 1"));
$num 0;
while (
$post mysql_fetch_assoc($q)) {
    echo 
"<div class='comm'>";
    
$ank user::get_user($post['id_user']);
    
$count_komms mysql_result(mysql_query("SELECT COUNT(*) FROM `diary_komm` WHERE `id_diary` = '$post[id]'"), 0);

    echo 
img("" . ($post['poll'] == 'poll_1' 'book') . ".png"'') . " <a href='/modules/diary/$post[id]/read'>" . ($post['name'] != NULL output_title($post['name']) : text_cutter($post['text'], 30) . "" . (text_cutter($post['text'], 30) != $post['text'] ? '...' null) . "") . "</a>n";
    echo 
"<span style='float:right;'>" . (isset($rating) ? "<span class = 'add'>" img('star.png''') . " <small>$post[rating]</small></span>" "") . "</span><br />";
    echo 
"" output_title(text_cutter($post['text'], 100)) . "" . (text_cutter($post['text'], 100) != $post['text'] ? "... <a href='/modules/diary/$post[id]/read?p'>подробнее →</a>" null) . "<br /><br />n";
    echo 
"<span class = 'add'>";
    echo 
user($ank['id']) . "n";
    echo 
"<small>" date::times($post['time']) . "</small></span>n";
    echo 
"<a class = 'add' href='/modules/diary/$post[id]/read#komms'>" img('comment_white_mini.png''') . " Обсудить" . ($count_komms != " ($count_komms)" null) . "</a>";
    echo 
"</div>n";
}

if (
$k_page 1) {
    
str("?" . (isset($rating) ? 'rating&' null) . ""$k_page$page);
// Вывод страниц
if (isset($user) && $user['id'] == $ank['id']) {
    echo 
"<div class='comm'><a href='/modules/diary/desc'>" img('set.png''') . " Редактировать описание</a></div>n";
}
if (isset(
$umodd)) {
    echo 
"<div class = 'comm'>";
    echo 
"<span style = 'float:right;'>";
    echo 
"<a class = 'add'>" mysql_result(mysql_query("SELECT COUNT(*) FROM `diary` WHERE `sk` = '1' AND `id_user` = '$ank[id]'"), 0) . "</a>";
    echo 
"</span>";
    echo 
"<a href = '/modules/diary/sk/$ank[id]'>" img('lock_edit.png''16') . " Заблокированные записи $ank[nick]</a>";
    echo 
"</div>";
}
require_once 
'sys/inc/tfoot.php';
exit;
Онлайн: 0
Реклама