Exemple #1
0
require_once '../includes/header.php';
include_once '../themes/header.php';
$act = isset($_GET['act']) ? check($_GET['act']) : 'index';
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
$tid = isset($_GET['tid']) ? abs(intval($_GET['tid'])) : 0;
show_title('Мои закладки');
if (is_user()) {
    switch ($act) {
        ############################################################################################
        ##                                    Главная страница                                    ##
        ############################################################################################
        case 'index':
            $total = DB::run()->querySingle("SELECT count(*) FROM `bookmarks` WHERE `book_user`=?;", array($log));
            if ($total > 0) {
                if ($start >= $total) {
                    $start = last_page($total, $config['forumtem']);
                }
                $querytopic = DB::run()->query("SELECT `topics`.*, `bookmarks`.* FROM `bookmarks` LEFT JOIN `topics` ON `bookmarks`.`book_topic`=`topics`.`topics_id` WHERE `book_user`=?  ORDER BY `topics_last_time` DESC LIMIT " . $start . ", " . $config['forumtem'] . ";", array($log));
                $topics = $querytopic->fetchAll();
                render('forum/bookmark', array('topics' => $topics, 'start' => $start));
                page_strnavigation('bookmark.php?', $config['forumtem'], $start, $total);
            } else {
                show_error('Закладок еще нет!');
            }
            break;
            ############################################################################################
            ##                                Добавление закладок                                     ##
            ############################################################################################
        ############################################################################################
        ##                                Добавление закладок                                     ##
        ############################################################################################
Exemple #2
0
if (isset($_GET['act'])) {
    $act = check($_GET['act']);
} else {
    $act = 'index';
}
show_title('Контакт-лист');
if (is_user()) {
    switch ($act) {
        ############################################################################################
        ##                                    Главная страница                                    ##
        ############################################################################################
        case 'index':
            $total = DB::run()->querySingle("SELECT count(*) FROM `contact` WHERE `contact_user`=?;", array($log));
            if ($total > 0) {
                if ($start >= $total) {
                    $start = last_page($total, $config['contactlist']);
                }
                $querycontact = DB::run()->query("SELECT * FROM `contact` WHERE `contact_user`=? ORDER BY `contact_time` DESC LIMIT " . $start . ", " . $config['contactlist'] . ";", array($log));
                echo '<form action="contact.php?act=del&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
                while ($data = $querycontact->fetch()) {
                    echo '<div class="b">';
                    echo '<div class="img">' . user_avatars($data['contact_name']) . '</div>';
                    echo '<b>' . profile($data['contact_name']) . '</b> <small>(' . date_fixed($data['contact_time']) . ')</small><br />';
                    echo user_title($data['contact_name']) . ' ' . user_online($data['contact_name']) . '</div>';
                    echo '<div>';
                    if (!empty($data['contact_text'])) {
                        echo 'Заметка: ' . $data['contact_text'] . '<br />';
                    }
                    echo '<input type="checkbox" name="del[]" value="' . $data['contact_id'] . '" /> ';
                    echo '<a href="/pages/private.php?act=submit&amp;uz=' . $data['contact_name'] . '">Написать</a> | ';
                    echo '<a href="/pages/perevod.php?uz=' . $data['contact_name'] . '">Перевод</a> | ';
Exemple #3
0
     ############################################################################################
 ############################################################################################
 ##                                  Просмотр переписки                                    ##
 ############################################################################################
 case 'history':
     echo '<img src="/images/img/mail.gif" alt="image" /> <a href="private.php">Входящие</a> / ';
     echo '<a href="private.php?act=output">Отправленные</a> / ';
     echo '<a href="private.php?act=trash">Корзина</a><hr />';
     if ($uz != $log) {
         $queryuser = DB::run()->querySingle("SELECT `users_id` FROM `users` WHERE `users_login`=? LIMIT 1;", array($uz));
         if (!empty($queryuser)) {
             $total = DB::run()->query("SELECT count(*) FROM `inbox` WHERE `inbox_user`=? AND `inbox_author`=? UNION ALL SELECT count(*) FROM `outbox` WHERE `outbox_user`=? AND `outbox_author`=?;", array($log, $uz, $uz, $log));
             $total = array_sum($total->fetchAll(PDO::FETCH_COLUMN));
             if ($total > 0) {
                 if ($start >= $total) {
                     $start = last_page($total, $config['privatpost']);
                 }
                 $queryhistory = DB::run()->query("SELECT * FROM `inbox` WHERE `inbox_user`=? AND `inbox_author`=? UNION ALL SELECT * FROM `outbox` WHERE `outbox_user`=? AND `outbox_author`=? ORDER BY `inbox_time` DESC LIMIT " . $start . ", " . $config['privatpost'] . ";", array($log, $uz, $uz, $log));
                 while ($data = $queryhistory->fetch()) {
                     echo '<div class="b">';
                     echo user_avatars($data['inbox_author']);
                     echo '<b>' . profile($data['inbox_author']) . '</b> ' . user_online($data['inbox_author']) . ' (' . date_fixed($data['inbox_time']) . ')</div>';
                     echo '<div>' . bb_code($data['inbox_text']) . '</div>';
                 }
                 page_strnavigation('private.php?act=history&amp;uz=' . $uz . '&amp;', $config['privatpost'], $start, $total);
                 if (!user_privacy($uz) || is_admin() || is_contact($uz, $log)) {
                     echo '<br /><div class="form">';
                     echo '<form action="private.php?act=send&amp;uz=' . $uz . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
                     echo 'Сообщение:<br />';
                     echo '<textarea cols="25" rows="5" name="msg"></textarea><br />';
                     if ($udata['users_point'] < $config['privatprotect']) {
Exemple #4
0
     } else {
         show_login('Вы не авторизованы, чтобы удалять фотографии, необходимо');
     }
     echo '<img src="/images/img/back.gif" alt="image" /> <a href="album.php?act=photo&amp;start=' . $start . '">Вернуться</a><br />';
     break;
     ############################################################################################
     ##                             Переадресация на последнюю страницу                        ##
     ############################################################################################
 ############################################################################################
 ##                             Переадресация на последнюю страницу                        ##
 ############################################################################################
 case 'end':
     $query = DB::run()->queryFetch("SELECT count(*) as `total_comments` FROM `commphoto` WHERE `commphoto_gid`=? LIMIT 1;", array($gid));
     if (!empty($query)) {
         $total_comments = empty($query['total_comments']) ? 1 : $query['total_comments'];
         $end = last_page($total_comments, $config['postgallery']);
         redirect("index.php?act=comments&gid={$gid}&start={$end}");
     } else {
         show_error('Ошибка! Комментарий к данному изображению не существует!');
     }
     echo '<img src="/images/img/back.gif" alt="image" /> <a href="index.php">В галерею</a><br />';
     break;
     ############################################################################################
     ##                                   Удаление фотографий                                  ##
     ############################################################################################
     /**
      * case 'delphoto':
      *
      * $uid = check($_GET['uid']);
      * if (isset($_POST['del'])) {$del = intar($_POST['del']);} else {$del = 0;}
      *
Exemple #5
0
                    show_error('Ошибка! Отстутствуют выбранные комментарии для удаления!');
                }
            } else {
                show_error('Ошибка! Неверный идентификатор сессии, повторите действие!');
            }
        } else {
            show_error('Ошибка! Удалять комментарии могут только модераторы!');
        }
        echo '<img src="/images/img/back.gif" alt="image" /> <a href="offers.php?act=comments&amp;id=' . $id . '">Вернуться</a><br />';
        break;
        ############################################################################################
        ##                             Переадресация на последнюю страницу                        ##
        ############################################################################################
    ############################################################################################
    ##                             Переадресация на последнюю страницу                        ##
    ############################################################################################
    case 'end':
        $query = DB::run()->queryFetch("SELECT count(*) as `total_comments` FROM `commoffers` WHERE `comm_offers`=? LIMIT 1;", array($id));
        if (!empty($query)) {
            $total_comments = empty($query['total_comments']) ? 1 : $query['total_comments'];
            $end = last_page($total_comments, $config['postcommoffers']);
            redirect("offers.php?act=comments&id={$id}&start={$end}");
        } else {
            show_error('Ошибка! Данного предложения или проблемы не существует!');
        }
        echo '<img src="/images/img/back.gif" alt="image" /> <a href="offers.php">Вернуться</a><br />';
        break;
    default:
        redirect("offers.php");
}
include_once '../themes/footer.php';
Exemple #6
0
                    show_error('Ошибка! Отстутствуют выбранные комментарии для удаления!');
                }
            } else {
                show_error('Ошибка! Неверный идентификатор сессии, повторите действие!');
            }
        } else {
            show_error('Ошибка! Удалять комментарии могут только модераторы!');
        }
        render('includes/back', array('link' => 'blog.php?act=comments&amp;id=' . $id . '&amp;start=' . $start, 'title' => 'Вернуться'));
        break;
        ############################################################################################
        ##                             Переадресация на последнюю страницу                        ##
        ############################################################################################
    ############################################################################################
    ##                             Переадресация на последнюю страницу                        ##
    ############################################################################################
    case 'end':
        $query = DB::run()->queryFetch("SELECT count(*) as `total_comments` FROM `commblog` WHERE `commblog_blog`=? LIMIT 1;", array($id));
        if (!empty($query['total_comments'])) {
            $total_comments = empty($query['total_comments']) ? 1 : $query['total_comments'];
            $end = last_page($total_comments, $config['blogpost']);
            redirect("blog.php?act=comments&id={$id}&start={$end}");
        } else {
            show_error('Ошибка! Комментарий к данной статье не существует!');
        }
        render('includes/back', array('link' => 'index.php', 'title' => 'К блогам'));
        break;
    default:
        redirect("blog.php");
}
include_once '../themes/footer.php';
Exemple #7
0
                    show_error('Ошибка! Отстутствуют выбранные комментарии для удаления!');
                }
            } else {
                show_error('Ошибка! Неверный идентификатор сессии, повторите действие!');
            }
        } else {
            show_error('Ошибка! Удалять комментарии могут только модераторы!');
        }
        echo '<img src="/images/img/back.gif" alt="image" /> <a href="down.php?act=comments&amp;id=' . $id . '&amp;start=' . $start . '">Вернуться</a><br />';
        break;
        ############################################################################################
        ##                             Переадресация на последнюю страницу                        ##
        ############################################################################################
    ############################################################################################
    ##                             Переадресация на последнюю страницу                        ##
    ############################################################################################
    case 'end':
        $query = DB::run()->queryFetch("SELECT count(*) as `total_comments` FROM `commload` WHERE `commload_down`=? LIMIT 1;", array($id));
        if (!empty($query)) {
            $total_comments = empty($query['total_comments']) ? 1 : $query['total_comments'];
            $end = last_page($total_comments, $config['downcomm']);
            redirect("down.php?act=comments&id={$id}&start={$end}");
        } else {
            show_error('Ошибка! Данного файла не существует!');
        }
        break;
    default:
        redirect("index.php");
}
echo '<img src="/images/img/reload.gif" alt="image" /> <a href="index.php">Категории</a><br />';
include_once '../themes/footer.php';
Exemple #8
0
     } else {
         show_error('Комментариев еще нет!');
     }
     break;
     ############################################################################################
     ##                                  Вывод комментариев                                    ##
     ############################################################################################
 ############################################################################################
 ##                                  Вывод комментариев                                    ##
 ############################################################################################
 case 'comments':
     show_title('Список всех комментариев ' . nickname($uz));
     $total = DB::run()->querySingle("SELECT count(*) FROM `commphoto` WHERE `commphoto_user`=?;", array($uz));
     if ($total > 0) {
         if ($start >= $total) {
             $start = last_page($total, $config['postgallery']);
         }
         $page = floor(1 + $start / $config['postgallery']);
         $config['newtitle'] = 'Список всех комментариев ' . nickname($uz) . ' (Стр. ' . $page . ')';
         $querycomm = DB::run()->query("SELECT `commphoto`.*, `photo_title` FROM `commphoto` LEFT JOIN `photo` ON `commphoto`.`commphoto_gid`=`photo`.`photo_id` WHERE `commphoto_user`=? ORDER BY `commphoto_time` DESC LIMIT " . $start . ", " . $config['postgallery'] . ";", array($uz));
         while ($data = $querycomm->fetch()) {
             echo '<div class="b"><img src="/images/img/balloon.gif" alt="image" /> <b><a href="comments.php?act=viewcomm&amp;gid=' . $data['commphoto_gid'] . '&amp;cid=' . $data['commphoto_id'] . '">' . $data['photo_title'] . '</a></b>';
             if (is_admin()) {
                 echo ' — <a href="comments.php?act=del&amp;id=' . $data['commphoto_id'] . '&amp;uz=' . $uz . '&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '">Удалить</a>';
             }
             echo '</div>';
             echo '<div>' . bb_code($data['commphoto_text']) . '<br />';
             echo 'Написал: ' . profile($data['commphoto_user']) . '</b> <small>(' . date_fixed($data['commphoto_time']) . ')</small><br />';
             if (is_admin() || empty($config['anonymity'])) {
                 echo '<span class="data">(' . $data['commphoto_brow'] . ', ' . $data['commphoto_ip'] . ')</span>';
             }
Exemple #9
0
#---------------------------------------------#
require_once '../includes/start.php';
require_once '../includes/functions.php';
require_once '../includes/header.php';
include_once '../themes/header.php';
$act = isset($_GET['act']) ? check($_GET['act']) : 'index';
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
show_title('Гостевая книга', 'Общение без ограничений');
switch ($act) {
    /**
     * Главная страница
     */
    case 'index':
        $total = DBM::run()->count('guest');
        if ($total > 0 && $start >= $total) {
            $start = last_page($total, $config['bookpost']);
        }
        $page = floor(1 + $start / $config['bookpost']);
        $config['newtitle'] = 'Гостевая книга (Стр. ' . $page . ')';
        $posts = DBM::run()->select('guest', null, $config['bookpost'], $start, array('guest_time' => 'DESC'));
        render('book/index', array('posts' => $posts, 'start' => $start, 'total' => $total));
        break;
        /**
         * Добавление сообщения
         */
    /**
     * Добавление сообщения
     */
    case 'add':
        $msg = check($_POST['msg']);
        $uid = check($_GET['uid']);
Exemple #10
0
if (isset($_GET['act'])) {
    $act = check($_GET['act']);
} else {
    $act = 'index';
}
show_title('Игнор-лист');
if (is_user()) {
    switch ($act) {
        ############################################################################################
        ##                                    Главная страница                                    ##
        ############################################################################################
        case 'index':
            $total = DB::run()->querySingle("SELECT count(*) FROM `ignore` WHERE `ignore_user`=?;", array($log));
            if ($total > 0) {
                if ($start >= $total) {
                    $start = last_page($total, $config['ignorlist']);
                }
                $queryignor = DB::run()->query("SELECT * FROM `ignore` WHERE `ignore_user`=? ORDER BY `ignore_time` DESC LIMIT " . $start . ", " . $config['ignorlist'] . ";", array($log));
                echo '<form action="ignore.php?act=del&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
                while ($data = $queryignor->fetch()) {
                    echo '<div class="b">';
                    echo '<div class="img">' . user_avatars($data['ignore_name']) . '</div>';
                    echo '<b>' . profile($data['ignore_name']) . '</b> <small>(' . date_fixed($data['ignore_time']) . ')</small><br />';
                    echo user_title($data['ignore_name']) . ' ' . user_online($data['ignore_name']) . '</div>';
                    echo '<div>';
                    if (!empty($data['ignore_text'])) {
                        echo 'Заметка: ' . $data['ignore_text'] . '<br />';
                    }
                    echo '<input type="checkbox" name="del[]" value="' . $data['ignore_id'] . '" /> ';
                    echo '<a href="private.php?act=submit&amp;uz=' . $data['ignore_name'] . '">Написать</a> | ';
                    echo '<a href="ignore.php?act=note&amp;id=' . $data['ignore_id'] . '">Заметка</a>';
Exemple #11
0
                }
            } else {
                show_error('Ошибка! Неверный идентификатор сессии, повторите действие!');
            }
        } else {
            show_error('Ошибка! Удалять комментарии могут только модераторы!');
        }
        echo '<img src="/images/img/reload.gif" alt="image" /> <a href="index.php?act=comments&amp;id=' . $id . '&amp;start=' . $start . '">Вернуться</a><br />';
        echo '<img src="/images/img/back.gif" alt="image" /> <a href="index.php">К новостям</a><br />';
        break;
        ############################################################################################
        ##                             Переадресация на последнюю страницу                        ##
        ############################################################################################
    ############################################################################################
    ##                             Переадресация на последнюю страницу                        ##
    ############################################################################################
    case 'end':
        $query = DB::run()->queryFetch("SELECT count(*) as `total_comments` FROM `commnews` WHERE `commnews_news_id`=? LIMIT 1;", array($id));
        if (!empty($query)) {
            $total_comments = empty($query['total_comments']) ? 1 : $query['total_comments'];
            $end = last_page($total_comments, $config['postnews']);
            redirect("index.php?act=comments&id={$id}&start={$end}");
        } else {
            show_error('Ошибка! Данной новости не существует!');
        }
        echo '<img src="/images/img/back.gif" alt="image" /> <a href="index.php">К новостям</a><br />';
        break;
    default:
        redirect("index.php");
}
include_once '../themes/footer.php';
Exemple #12
0
echo 'Сортировать: ';
if ($order == 'photo_rating') {
    echo '<b><a href="top.php?sort=rated">Оценки</a></b>, ';
} else {
    echo '<a href="top.php?sort=rated">Оценки</a>, ';
}
if ($order == 'photo_comments') {
    echo '<b><a href="top.php?sort=comm">Комментарии</a></b>';
} else {
    echo '<a href="top.php?sort=comm">Комментарии</a>';
}
echo '<hr />';
$total = DB::run()->querySingle("SELECT count(*) FROM `photo`;");
if ($total > 0) {
    if ($start >= $total) {
        $start = last_page($total, $config['fotolist']);
    }
    $queryphoto = DB::run()->query("SELECT * FROM `photo` ORDER BY " . $order . " DESC LIMIT " . $start . ", " . $config['fotolist'] . ";");
    while ($data = $queryphoto->fetch()) {
        echo '<div class="b"><img src="/images/img/gallery.gif" alt="image" /> ';
        echo '<b><a href="index.php?act=view&amp;gid=' . $data['photo_id'] . '&amp;start=' . $start . '">' . $data['photo_title'] . '</a></b> (' . read_file(BASEDIR . '/upload/pictures/' . $data['photo_link']) . ') (' . format_num($data['photo_rating']) . ')</div>';
        echo '<div><a href="index.php?act=view&amp;gid=' . $data['photo_id'] . '&amp;start=' . $start . '">' . resize_image('upload/pictures/', $data['photo_link'], $config['previewsize'], array('alt' => $data['photo_title'])) . '</a>';
        echo '<br />' . bb_code($data['photo_text']) . '<br />';
        echo 'Добавлено: ' . profile($data['photo_user']) . ' (' . date_fixed($data['photo_time']) . ')<br />';
        echo '<a href="index.php?act=comments&amp;gid=' . $data['photo_id'] . '">Комментарии</a> (' . $data['photo_comments'] . ') ';
        echo '<a href="index.php?act=end&amp;gid=' . $data['photo_id'] . '">&raquo;</a>';
        echo '</div>';
    }
    page_strnavigation('top.php?sort=' . $sort . '&amp;', $config['fotolist'], $start, $total);
} else {
    show_error('Загруженных фотографий еще нет!');
Exemple #13
0
include_once '../themes/header.php';
$act = isset($_GET['act']) ? check($_GET['act']) : 'index';
$id = isset($_GET['id']) ? abs(intval($_GET['id'])) : 0;
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
if (is_admin()) {
    show_title('Управление событиями');
    switch ($act) {
        ############################################################################################
        ##                                    Главная страница                                    ##
        ############################################################################################
        case 'index':
            echo '<div class="form"><a href="/events/index.php">Обзор событий</a></div>';
            $total = DB::run()->querySingle("SELECT count(*) FROM `events`;");
            if ($total > 0) {
                if ($start >= $total) {
                    $start = last_page($total, $config['postevents']);
                }
                $queryevents = DB::run()->query("SELECT * FROM `events` ORDER BY `event_time` DESC LIMIT " . $start . ", " . $config['postevents'] . ";");
                echo '<form action="events.php?act=del&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
                while ($data = $queryevents->fetch()) {
                    echo '<div class="b">';
                    $icon = empty($data['event_closed']) ? 'document_plus.gif' : 'document_minus.gif';
                    echo '<img src="/images/img/' . $icon . '" alt="image" /> ';
                    echo '<b><a href="/events/index.php?act=read&amp;id=' . $data['event_id'] . '">' . $data['event_title'] . '</a></b><small> (' . date_fixed($data['event_time']) . ')</small><br />';
                    echo '<input type="checkbox" name="del[]" value="' . $data['event_id'] . '" /> ';
                    echo '<a href="events.php?act=edit&amp;id=' . $data['event_id'] . '&amp;start=' . $start . '">Редактировать</a></div>';
                    if (!empty($data['event_image'])) {
                        echo '<div class="img"><a href="/upload/events/' . $data['event_image'] . '">' . resize_image('upload/events/', $data['event_image'], 75, array('alt' => $data['event_title'])) . '</a></div>';
                    }
                    if (!empty($data['event_top'])) {
                        echo '<div class="right"><span style="color:#ff0000">На главной</span></div>';
Exemple #14
0
     } else {
         show_error('Статей еще нет!');
     }
     break;
     ############################################################################################
     ##                                     Вывод сообщений                                    ##
     ############################################################################################
 ############################################################################################
 ##                                     Вывод сообщений                                    ##
 ############################################################################################
 case 'comments':
     show_title('Список всех комментариев ' . $uz);
     $total = DB::run()->querySingle("SELECT count(*) FROM `commblog` WHERE `commblog_author`=?;", array($uz));
     if ($total > 0) {
         if ($start >= $total) {
             $start = last_page($total, $config['blogpost']);
         }
         $is_admin = is_admin();
         $querycomments = DB::run()->query("SELECT `commblog`.*, `blogs_title`, `blogs_comments` FROM `commblog` LEFT JOIN `blogs` ON `commblog`.`commblog_blog`=`blogs`.`blogs_id` WHERE `commblog_author`=? ORDER BY `commblog_time` DESC LIMIT " . $start . ", " . $config['blogpost'] . ";", array($uz));
         $comments = $querycomments->fetchAll();
         render('blog/active_comments', array('comments' => $comments, 'start' => $start));
         page_strnavigation('active.php?act=comments&amp;uz=' . $uz . '&amp;', $config['blogpost'], $start, $total);
     } else {
         show_error('Комментарии не найдены!');
     }
     break;
     ############################################################################################
     ##                                 Удаление комментариев                                  ##
     ############################################################################################
 ############################################################################################
 ##                                 Удаление комментариев                                  ##
Exemple #15
0
 switch ($act) {
     ############################################################################################
     ##                                    Главная страница                                    ##
     ############################################################################################
     case 'index':
         echo '<a href="#down"><img src="/images/img/downs.gif" alt="image" /></a> ';
         echo '<a href="chat.php?rand=' . mt_rand(100, 999) . '">Обновить</a> / ';
         echo '<a href="/pages/smiles.php">Смайлы</a> / ';
         echo '<a href="/pages/tags.php">Теги</a><hr />';
         $total = DB::run()->querySingle("SELECT count(*) FROM `chat`;");
         if ($udata['users_newchat'] != stats_newchat()) {
             DB::run()->query("UPDATE `users` SET `users_newchat`=? WHERE `users_login`=? LIMIT 1;", array(stats_newchat(), $log));
         }
         if ($total > 0) {
             if ($start >= $total) {
                 $start = last_page($total, $config['chatpost']);
             }
             $querychat = DB::run()->query("SELECT * FROM `chat` ORDER BY `chat_time` DESC LIMIT " . $start . ", " . $config['chatpost'] . ";");
             while ($data = $querychat->fetch()) {
                 echo '<div class="b">';
                 echo '<div class="img">' . user_avatars($data['chat_user']) . '</div>';
                 echo '<b>' . profile($data['chat_user']) . '</b> <small>(' . date_fixed($data['chat_time']) . ')</small><br />';
                 echo user_title($data['chat_user']) . ' ' . user_online($data['chat_user']) . '</div>';
                 if ($log != $data['chat_user']) {
                     echo '<div class="right">';
                     echo '<a href="chat.php?act=reply&amp;id=' . $data['chat_id'] . '&amp;start=' . $start . '">Отв</a> / ';
                     echo '<a href="chat.php?act=quote&amp;id=' . $data['chat_id'] . '&amp;start=' . $start . '">Цит</a></div>';
                 }
                 if ($log == $data['chat_user'] && $data['chat_time'] + 600 > SITETIME) {
                     echo '<div class="right"><a href="chat.php?act=edit&amp;id=' . $data['chat_id'] . '&amp;start=' . $start . '">Редактировать</a></div>';
                 }
Exemple #16
0
        }
        break;
        ############################################################################################
        ##                                  Последние сообщения                                   ##
        ############################################################################################
    ############################################################################################
    ##                                  Последние сообщения                                   ##
    ############################################################################################
    case 'posts':
        show_title('Список последних сообщений');
        $total = DB::run()->querySingle("SELECT count(*) FROM `posts`;");
        if ($total > 0) {
            if ($total > 100) {
                $total = 100;
            }
            if ($start >= $total) {
                $start = last_page($total, $config['forumpost']);
            }
            $querypost = DB::run()->query("SELECT `posts`.*, `topics_title`, `topics_posts` FROM `posts` LEFT JOIN `topics` ON `posts`.`posts_topics_id`=`topics`.`topics_id` ORDER BY `posts_time` DESC LIMIT " . $start . ", " . $config['forumpost'] . ";");
            $posts = $querypost->fetchAll();
            render('forum/new_posts', array('posts' => $posts, 'start' => $start));
            page_strnavigation('new.php?act=posts&amp;', $config['forumpost'], $start, $total);
        } else {
            show_error('Сообщений еще нет!');
        }
        break;
    default:
        redirect("new.php");
}
render('includes/back', array('link' => 'index.php', 'title' => 'К форумам', 'icon' => 'reload.gif'));
include_once '../themes/footer.php';
Exemple #17
0
include_once '../themes/header.php';
$act = isset($_GET['act']) ? check($_GET['act']) : 'index';
$id = isset($_GET['id']) ? abs(intval($_GET['id'])) : 0;
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
if (is_admin(array(101, 102))) {
    show_title('Управление новостями');
    switch ($act) {
        ############################################################################################
        ##                                    Главная страница                                    ##
        ############################################################################################
        case 'index':
            echo '<div class="form"><a href="/news/index.php">Обзор новостей</a></div>';
            $total = DB::run()->querySingle("SELECT count(*) FROM `news`;");
            if ($total > 0) {
                if ($start >= $total) {
                    $start = last_page($total, $config['postnews']);
                }
                $querynews = DB::run()->query("SELECT * FROM `news` ORDER BY `news_time` DESC LIMIT " . $start . ", " . $config['postnews'] . ";");
                echo '<form action="news.php?act=del&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
                while ($data = $querynews->fetch()) {
                    echo '<div class="b">';
                    $icon = empty($data['news_closed']) ? 'document_plus.gif' : 'document_minus.gif';
                    echo '<img src="/images/img/' . $icon . '" alt="image" /> ';
                    echo '<b><a href="/news/index.php?act=read&amp;id=' . $data['news_id'] . '">' . $data['news_title'] . '</a></b><small> (' . date_fixed($data['news_time']) . ')</small><br />';
                    echo '<input type="checkbox" name="del[]" value="' . $data['news_id'] . '" /> ';
                    echo '<a href="news.php?act=edit&amp;id=' . $data['news_id'] . '&amp;start=' . $start . '">Редактировать</a></div>';
                    if (!empty($data['news_image'])) {
                        echo '<div class="img"><a href="/upload/news/' . $data['news_image'] . '">' . resize_image('upload/news/', $data['news_image'], 75, array('alt' => $data['news_title'])) . '</a></div>';
                    }
                    if (!empty($data['news_top'])) {
                        echo '<div class="right"><span style="color:#ff0000">На главной</span></div>';
//require_once('function/security.php');
require_once 'database/connection.php';
require_once 'includes/output.html.php';
require_once 'function/data_holder.php';
//create short variable names
$email = $_POST['email'];
$password = $_POST['password'];
if (!empty($_POST['email']) && !empty($_POST['password'])) {
    // they have just tried logging in
    try {
        login($email, $password);
        // if they are in the database register the user id
        session_start();
        $_SESSION['valid_user'] = $email;
        $cookie_name = 'login';
        setcookie($cookie_name, $email, time() + 3600, "/");
        if (!last_page()) {
            header("Location:index.php");
        }
    } catch (Exception $e) {
        // unsuccessful login
        add_header('Problem:');
        echo "<div class='wrapper' style=' position:relative; left:-200px; width:30%; height:20em; '>";
        echo '<h3 style="margin-top:20%; width:180%;">You could not be logged in. You must be logged in to view this page.</h3><br/>';
        echo "<b>Try Again!</b><br/><hr/>";
        do_html_url('login.php', 'Login');
        echo "</div>";
        add_footer();
        exit;
    }
}
Exemple #19
0
include_once '../themes/header.php';
$act = isset($_GET['act']) ? check($_GET['act']) : 'index';
$id = isset($_GET['id']) ? abs(intval($_GET['id'])) : 0;
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
if (!is_admin(array(101, 102))) {
    redirect('/admin/');
}
show_title('Управление смайлами');
switch ($act) {
    /**
     * Список смайлов
     */
    case 'index':
        $total = DBM::run()->count('smiles');
        if ($total > 0 && $start >= $total) {
            $start = last_page($total, $config['smilelist']);
        }
        $smiles = DBM::run()->query("SELECT * FROM `smiles` ORDER BY CHAR_LENGTH(`smiles_code`) ASC LIMIT :start, :limit;", array('start' => intval($start), 'limit' => intval($config['smilelist'])));
        echo '<form action="smiles.php?act=del&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
        foreach ($smiles as $smile) {
            echo '<img src="/images/smiles/' . $smile['smiles_name'] . '" alt="" /> — <b>' . $smile['smiles_code'] . '</b><br />';
            echo '<input type="checkbox" name="del[]" value="' . $smile['smiles_id'] . '" /> <a href="smiles.php?act=edit&amp;id=' . $smile['smiles_id'] . '&amp;start=' . $start . '">Редактировать</a><br />';
        }
        echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
        page_strnavigation('smiles.php?', $config['smilelist'], $start, $total);
        echo 'Всего cмайлов: <b>' . $total . '</b><br /><br />';
        //show_error('Смайлы еще не загружены!');
        echo '<img src="/images/img/download.gif" alt="image" /> <a href="smiles.php?act=add&amp;start=' . $start . '">Загрузить</a><br />';
        break;
        /**
         * Форма загрузки смайла