Example #1
0
#            Skype  :  vantuzilla             #
#---------------------------------------------#
require_once '../includes/start.php';
require_once '../includes/functions.php';
require_once '../includes/header.php';
header('Content-type: application/json');
header('Content-Disposition: inline; filename="private.json";');
$key = !empty($_REQUEST['key']) ? check($_REQUEST['key']) : null;
$count = !empty($_REQUEST['count']) ? abs(intval($_REQUEST['count'])) : 10;
if (!empty($key)) {
    $user = DB::run()->queryFetch("SELECT * FROM `users` WHERE `users_apikey`=? LIMIT 1;", array($key));
    if (!empty($user)) {
        $query = DB::run()->query("SELECT * FROM `inbox` WHERE `inbox_user`=? ORDER BY `inbox_time` DESC LIMIT " . $count . ";", array($user['users_login']));
        $inbox = $query->fetchAll();
        $total = count($inbox);
        if ($total > 0) {
            $messages = array();
            foreach ($inbox as $data) {
                $data['inbox_text'] = bb_code(str_replace('<img src="/images/', '<img src="' . $config['home'] . '/images/', $data['inbox_text']));
                $messages[] = array('author' => $data['inbox_author'], 'text' => $data['inbox_text'], 'time' => $data['inbox_time']);
            }
            echo json_encode(array('total' => $total, 'messages' => $messages));
        } else {
            echo json_encode(array('error' => 'nomessages'));
        }
    } else {
        echo json_encode(array('error' => 'nouser'));
    }
} else {
    echo json_encode(array('error' => 'nokey'));
}
Example #2
0
         <a href="' . get_link('Poster', 'Guild', array('action' => 'edit', 'p' => $Post_ID)) . '"><span alt="Editer" title="Editer ce message" >&check;</span></a></td></tr>';
                    } else {
                        echo '<td>
         Posté à ' . $d->format('H\\hi \\l\\e d M y') . '
         </td></tr>';
                    }
                    $d = new datetime($Account_Inscription);
                    //Détails sur le Account qui a posté
                    echo '<tr><td>
         <img src="./images/avatars/' . $Account_Avatar . '" alt="" />
         <br />Membre inscrit le ' . $d->format('d/m/Y') . '
         <br />Messages : ' . $Account_Post . '<br />
         Localisation : ' . $Account_localisation . '</td>';
                    //Message
                    echo '<td>' . bb_code($Post_texte) . '
         <br /><hr />' . bb_code($Account_Signature) . '</td></tr>';
                }
                //Fin de la boucle ! \o/
                ?>
</table>

<?php 
                echo '<p>Page : ';
                for ($i = 1; $i <= $nombreDePages; $i++) {
                    //On affiche pas la page actuelle en lien
                    echo $i == $numpage ? $i : '<a href="' . get_link('Topic', 'Guild', array('t' => $Topic_ID, 'page' => $i)) . '">' . $i . '</a> ';
                }
                echo '</p>';
            }
            //Fin du if qui vérifiait si le topic contenait au moins un message
        }
Example #3
0
     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>';
             }
             echo '</div>';
         }
         page_strnavigation('comments.php?act=comments&amp;uz=' . $uz . '&amp;', $config['postgallery'], $start, $total);
     } else {
         show_error('Комментариев еще нет!');
     }
     break;
     ############################################################################################
     ##                                     Переход к сообщение                                ##
     ############################################################################################
 ############################################################################################
Example #4
0
function account_msg_read($id)
{
    global $db;
    $msg = $db->fetch_assoc('SELECT `touser`, `fromuser`, `title`, `msg`, `del`, `fromdel`, `datum`, `readed` FROM ' . DB_PRE . 'ecp_messages WHERE msgID = ' . $id);
    if (isset($msg['touser'])) {
        if ($msg['touser'] == $_SESSION['userID']) {
            if (!$msg['readed']) {
                $db->query('UPDATE ' . DB_PRE . 'ecp_messages SET readed = 1 WHERE msgID = ' . $id);
            }
            $tpl = new smarty();
            $tpl->assign('in', 1);
            $tpl->assign('id', $id);
            $tpl->assign('userid', $msg['fromuser']);
            $tpl->assign('msg', bb_code(nl2br($msg['msg'])));
            $tpl->assign('del', $msg['del']);
            $tpl->assign('datum', date(LONG_DATE, $msg['datum']));
            if ($msg['fromuser']) {
                $row = @$db->fetch_assoc('SELECT username, country FROM ' . DB_PRE . 'ecp_user WHERE ID= ' . $msg['fromuser']);
                $tpl->assign('username', $row['username']);
                $tpl->assign('country', $row['country']);
            }
            $tpl->assign('title', $msg['title']);
            ob_start();
            $tpl->display(DESIGN . '/tpl/account/message_read.html');
            $content = ob_get_contents();
            ob_end_clean();
            main_content(MESSAGE, $content, '', 1);
        } elseif ($msg['fromuser'] == $_SESSION['userID']) {
            $tpl = new smarty();
            $tpl->assign('id', $id);
            $tpl->assign('msg', bb_code(nl2br($msg['msg'])));
            $tpl->assign('userid', $msg['touser']);
            $tpl->assign('fromdel', $msg['fromdel']);
            $tpl->assign('datum', date(LONG_DATE, $msg['datum']));
            $row = @$db->fetch_assoc('SELECT username, country FROM ' . DB_PRE . 'ecp_user WHERE ID= ' . $msg['touser']);
            $tpl->assign('username', $row['username']);
            $tpl->assign('country', $row['country']);
            $tpl->assign('title', $msg['title']);
            ob_start();
            $tpl->display(DESIGN . '/tpl/account/message_read.html');
            $content = ob_get_contents();
            ob_end_clean();
            main_content(MESSAGE, $content, '', 1);
        } else {
            table(ERROR, NO_ACCESS_RIGHTS);
            account_msgbox();
        }
    } else {
        table(ERROR, NO_ENTRIES_ID);
        account_msgbox();
    }
}
Example #5
0
 if ($total > 0) {
     if ($start >= $total) {
         $start = 0;
     }
     $queryhist = DB::run()->query("SELECT * FROM `banhist` WHERE `ban_user`=? ORDER BY `ban_time` DESC LIMIT " . $start . ", " . $config['listbanhist'] . ";", array($uz));
     echo '<form action="banhist.php?act=del&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
     while ($data = $queryhist->fetch()) {
         echo '<div class="b">';
         echo '<div class="img">' . user_avatars($data['ban_user']) . '</div>';
         echo '<b>' . profile($data['ban_user']) . '</b> ' . user_online($data['ban_user']) . ' ';
         echo '<small>(' . date_fixed($data['ban_time']) . ')</small><br />';
         echo '<input type="checkbox" name="del[]" value="' . $data['ban_id'] . '" /> ';
         echo '<a href="zaban.php?act=editban&amp;uz=' . $data['ban_user'] . '">Изменить</a></div>';
         echo '<div>';
         if (!empty($data['ban_type'])) {
             echo 'Причина: ' . bb_code($data['ban_reason']) . '<br />';
             echo 'Срок: ' . formattime($data['ban_term']) . '<br />';
         }
         switch ($data['ban_type']) {
             case '1':
                 $stat = '<span style="color:#ff0000">Забанил</span>:';
                 break;
             case '2':
                 $stat = '<span style="color:#ffa500">Изменил</span>:';
                 break;
             default:
                 $stat = '<span style="color:#00cc00">Разбанил</span>:';
         }
         echo $stat . ' ' . profile($data['ban_send']) . '<br />';
         echo '</div>';
     }
Example #6
0
    ?>
&amp;id=<?php 
    echo $data['posts_id'];
    ?>
"><?php 
    echo $data['topics_title'];
    ?>
</a></b>
		(<?php 
    echo $data['topics_posts'];
    ?>
)
	</div>
	<div>
		<?php 
    echo bb_code($data['posts_text']);
    ?>
<br />

		Написал: <?php 
    echo nickname($data['posts_user']);
    ?>
 <?php 
    echo user_online($data['posts_user']);
    ?>
 <small>(<?php 
    echo date_fixed($data['posts_time']);
    ?>
)</small><br />

		<?php 
Example #7
0
             case '3':
                 echo '<img src="/images/img/error.gif" alt="Закрыто" /> <b><span style="color:#ff0000">Закрыто</span></b>';
                 break;
             default:
                 echo '<img src="/images/img/faq.gif" alt="Под вопросом" /> <b><span style="color:#ffa500">Под вопросом</span></b>';
         }
         echo '</div>';
         echo '<div class="right"><a href="offers.php?act=edit&amp;id=' . $id . '">Редактировать</a> / ';
         echo '<a href="offers.php?act=reply&amp;id=' . $id . '">Ответить</a></div>';
         echo '<div>' . bb_code($queryoff['offers_text']) . '<br />';
         echo 'Добавлено: ' . profile($queryoff['offers_user']) . ' (' . date_fixed($queryoff['offers_time']) . ')<br />';
         echo '<a href="/pages/offers.php?act=comments&amp;id=' . $id . '">Комментарии</a> (' . $queryoff['offers_comments'] . ') ';
         echo '<a href="/pages/offers.php?act=end&amp;id=' . $id . '">&raquo;</a></div><br />';
         if (!empty($queryoff['offers_text_reply'])) {
             echo '<div class="b"><b>Официальный ответ</b></div>';
             echo '<div class="q">' . bb_code($queryoff['offers_text_reply']) . '<br />';
             echo profile($queryoff['offers_user_reply']) . ' (' . date_fixed($queryoff['offers_time_reply']) . ')</div><br />';
         }
     } else {
         show_error('Ошибка! Данного предложения или проблемы не существует!');
     }
     echo '<img src="/images/img/back.gif" alt="image" /> <a href="offers.php?type=' . $type . '">Вернуться</a><br />';
     break;
     ############################################################################################
     ##                                  Ответ на предложение                                  ##
     ############################################################################################
 ############################################################################################
 ##                                  Ответ на предложение                                  ##
 ############################################################################################
 case 'reply':
     $queryoff = DB::run()->queryFetch("SELECT * FROM `offers` WHERE `offers_id`=? LIMIT 1;", array($id));
Example #8
0
function forum_thread($bid, $id, $order = 'ASC', $quote = false)
{
    global $db, $installed, $countries;
    $thread = $db->fetch_assoc('SELECT `threadID`, `bID`, `threadname`, `vonID`, ' . DB_PRE . 'ecp_forum_threads.posts, `sticky`, ' . DB_PRE . 'ecp_forum_threads.closed, 
											`fsurveyID`, `rating`, `ratingvotes`, a.boardparentID, a.name, a.isforum, a.closed as forumclosed,
											 a.rightsread, a.postcom, a.editcom, a.votesurvey, a.downloadattch, a.threadclose, 
											a.threaddel, a.threadmove, a.threadpin, a.editmocom, a.delcom, b.rightsread as parentRead, b.name as boardparentName FROM ' . DB_PRE . 'ecp_forum_threads LEFT JOIN ' . DB_PRE . 'ecp_forum_boards AS a ON (bID = a.boardID) LEFT JOIN ' . DB_PRE . 'ecp_forum_boards AS b ON (b.boardID = a.boardparentID) WHERE threadID = ' . $id . ' AND bID = ' . $bid);
    if (isset($thread['threadID']) and find_access($thread['rightsread']) and find_access($thread['parentRead']) and $thread['isforum']) {
        $comments = array();
        $db->query('UPDATE ' . DB_PRE . 'ecp_forum_threads SET views = views + 1 WHERE threadID = ' . $id);
        $limits = get_sql_limit($thread['posts'] + 1, LIMIT_FORUM_COMMENTS);
        $result = $db->query('SELECT `comID`, ' . DB_PRE . 'ecp_forum_comments.userID, `postname`, a.rID, rankname, iconname, `adatum`, `comment`, `edits`, `editdatum`, `edituserID`, ' . DB_PRE . 'ecp_forum_comments.IP, `attachs`, a.username, a.sex, a.signatur, a.country, comments, d.money, a.avatar, b.username as editfrom, lastklick as online 
							FROM `' . DB_PRE . 'ecp_forum_comments` 
							LEFT JOIN ' . DB_PRE . 'ecp_user as a ON (' . DB_PRE . 'ecp_forum_comments.userID = a.ID)
							LEFT JOIN ' . DB_PRE . 'ecp_user as b ON (' . DB_PRE . 'ecp_forum_comments.edituserID = b.ID)
							LEFT JOIN ' . DB_PRE . 'ecp_user_stats as d ON (' . DB_PRE . 'ecp_forum_comments.userID = d.userID)
							LEFT JOIN ' . DB_PRE . 'ecp_ranks ON (a.rID = rankID)
							LEFT JOIN ' . DB_PRE . 'ecp_online ON (uID = ' . DB_PRE . 'ecp_forum_comments.userID AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ')
							WHERE boardID = ' . $bid . ' AND tID = ' . $id . '
							GROUP BY comID
							ORDER BY adatum ' . $order . '
							LIMIT ' . $limits[1] . ', ' . LIMIT_FORUM_COMMENTS);
        while ($row = mysql_fetch_assoc($result)) {
            if (isset($_SESSION['userID'])) {
                if (isset($_SESSION['lastforum'][$id]) and $_SESSION['lastforum'][$id] < $row['adatum']) {
                    $row['new'] = true;
                } elseif (!isset($_SESSION['lastforum'][$id]) and $_SESSION['lastforum']['time'] < $row['adatum']) {
                    $row['new'] = true;
                }
            }
            $row['adatum'] = forum_make_date($row['adatum']);
            $row['nr'] = ++$limits[1];
            $row['comments'] = format_nr($row['comments']);
            $row['countryname'] = @$countries[$row['country']];
            $row['quote'] = $row['comment'];
            $row['comment'] = bb_code($row['comment']);
            $row['sex'] == 'male' ? $row['sextext'] = MALE : ($row['sextext'] = FEMALE);
            if ($row['edits']) {
                $row['edit'] = str_replace(array('{anzahl}', '{von}', '{last}'), array($row['edits'], '<a href="?section=user&id=' . $row['edituserID'] . '">' . $row['editfrom'] . '</a>', date(LONG_DATE, $row['editdatum'])), COMMENT_EDIT_TXT);
            }
            if ($row['attachs']) {
                $anhaenge = array();
                $db->query('SELECT `attachID`, `name`, `size`, `downloads` FROM `' . DB_PRE . 'ecp_forum_attachments` WHERE `bID` = ' . $bid . ' AND `tID` = ' . $id . ' AND `mID` = ' . $row['comID']);
                while ($sub = $db->fetch_assoc()) {
                    $sub['size'] = goodsize($sub['size']);
                    $anhaenge[] = $sub;
                }
                $row['attchs'] = $anhaenge;
            }
            $comments[] = $row;
        }
        if (isset($_SESSION['userID'])) {
            if (!isset($_SESSION['lastforum'][$id])) {
                @$_SESSION['lastforum']['boards'][$bid]['new']--;
            }
            $_SESSION['lastforum']['boards'][$bid]['time'] = time();
            $_SESSION['lastforum'][$id] = time();
        }
        $tage = (time() - $installed) / 86400;
        $db->query('SELECT uID, username FROM ' . DB_PRE . 'ecp_online LEFT JOIN ' . DB_PRE . 'ecp_user ON (ID=uID) WHERE forum = 1 AND fboardID = ' . $bid . ' AND fthreadID = ' . $id . ' AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ' ORDER BY username ASC');
        $members = 0;
        $guests = 0;
        $member = '';
        while ($row = $db->fetch_assoc()) {
            if ($row['uID']) {
                $members++;
                $member .= ', <a href="?section=user&id=' . $row['uID'] . '">' . $row['username'] . '</a>';
            } else {
                $guests++;
            }
        }
        $tpl = new smarty();
        $tpl->assign('bewertung', $thread['ratingvotes'] != 0 ? str_replace(array('{anzahl}', '{avg}'), array(format_nr($thread['ratingvotes']), format_nr($thread['rating'], 2)), FORUM_RATING_VAL) : FORUM_NO_RATINGS);
        if (!@$_SESSION['userID'] or $db->result(DB_PRE . 'ecp_forum_ratings', 'COUNT(rateID)', 'userID = ' . $_SESSION['userID'] . ' AND tID = ' . $id)) {
            $tpl->assign('rating', get_forum_rating($thread['rating']));
        }
        if ($limits[0] > 1) {
            $seiten = makepagelink_ajax('?section=forum&action=thread&boardID=' . $bid . '&threadID=' . $id, 'return load_forum_com_page(' . $id . ', ' . $bid . ', {nr}, \'' . $order . '\');', @$_GET['page'], $limits[0]);
            $tpl->assign('seiten', $seiten);
        }
        $tpl->assign('order', $order);
        $tpl->assign('vonID', $thread['vonID']);
        $tpl->assign('sticky', $thread['sticky']);
        $tpl->assign('forenlinks', forum_get_fast_links());
        $tpl->assign('postcom', find_access($thread['postcom']));
        $tpl->assign('editcom', find_access($thread['editcom']));
        $tpl->assign('threadclose', find_access($thread['threadclose']));
        $tpl->assign('threaddel', find_access($thread['threaddel']));
        $tpl->assign('threadmove', find_access($thread['threadmove']));
        $tpl->assign('threadpin', find_access($thread['threadpin']));
        $tpl->assign('editmocom', find_access($thread['editmocom']));
        $tpl->assign('delcom', find_access($thread['delcom']));
        $tpl->assign('closed', $thread['closed']);
        $tpl->assign('bclosed', $thread['forumclosed']);
        $tpl->assign('comments', @$comments);
        $tpl->assign('name', $thread['threadname']);
        $tpl->assign('abo', $db->result(DB_PRE . 'ecp_forum_abo', 'COUNT(aboID)', 'userID = ' . (int) @$_SESSION['userID'] . ' AND thID = ' . $id));
        $tpl->assign('path', '<a href="?section=forum">' . FORUM . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> ' . ($thread['boardparentID'] ? '<a href="?section=forum&action=subboard&boardID=' . $thread['boardparentID'] . '">' . $thread['boardparentName'] . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> ' : '') . '<a href="?section=forum&amp;action=board&amp;boardID=' . $bid . '">' . $thread['name'] . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> <img src="templates/' . DESIGN . '/images/forum_thread_pin.png" id="pin_icon" alt="' . FORUM_STICKY . '" title="' . FORUM_STICKY . '"' . ($thread['sticky'] ? '' : ' style="display: none;"') . ' /> <img src="templates/' . DESIGN . '/images/forum_icon_thread_closed.png" id="closed_icon" alt="' . FORUM_THREAD_CLOSED . '" title="' . FORUM_THREAD_CLOSED . '"' . ($thread['closed'] ? '' : ' style="display: none;"') . ' /> ' . $thread['threadname']);
        $tpl->assign('members', substr($member, 2));
        $tpl->assign('thread', 1);
        $tpl->assign('quote', $quote);
        $tpl->assign('online', str_replace(array('{members}', '{guests}'), array(format_nr($members), format_nr($guests)), FORUM_ONLINE_THREAD));
        ob_start();
        if ($thread['fsurveyID']) {
            $tpl->assign('umfrage', 1);
            if (isset($_SESSION['userID'])) {
                $umfrage = $db->fetch_assoc('SELECT `ende`, `frage`, `antworten`, COUNT(voteID) AS anzahl FROM `' . DB_PRE . 'ecp_forum_survey` LEFT JOIN ' . DB_PRE . 'ecp_forum_survey_votes ON (fsurID = ' . $thread['fsurveyID'] . ' AND userID = ' . (int) @$_SESSION['userID'] . ') WHERE fsurveyID = ' . $thread['fsurveyID'] . ' AND boardID = ' . $bid . ' AND threadID = ' . $id . ' GROUP BY fsurveyID');
            } else {
                $umfrage = $db->fetch_assoc('SELECT `ende`, `frage`, `antworten`, COUNT(voteID) AS anzahl FROM `' . DB_PRE . 'ecp_forum_survey` LEFT JOIN ' . DB_PRE . 'ecp_forum_survey_votes ON (fsurID = ' . $thread['fsurveyID'] . ' AND IP = \'' . $_SERVER['REMOTE_ADDR'] . '\') WHERE fsurveyID = ' . $thread['fsurveyID'] . ' AND boardID = ' . $bid . ' AND threadID = ' . $id . ' GROUP BY fsurveyID');
            }
            $tpl->assign('antworten', $umfrage['antworten']);
            $tpl->assign('frage', $umfrage['frage']);
            if ($umfrage['ende']) {
                $tpl->assign('ende', date(LONG_DATE, $umfrage['ende']));
            }
            $db->query('SELECT `answerID`, `answer`, `votes` FROM ' . DB_PRE . 'ecp_forum_survey_answers WHERE fsID = ' . $thread['fsurveyID'] . ' ORDER BY answerID ASC');
            $gesamt = 0;
            $antworten = array();
            while ($row = $db->fetch_assoc()) {
                $gesamt += $row['votes'];
                $antworten[] = $row;
            }
            foreach ($antworten as $key => $value) {
                if ($gesamt) {
                    $antworten[$key]['prozent'] = round($value['votes'] / $gesamt * 100, 1);
                } else {
                    $antworten[$key]['prozent'] = 0;
                }
                $antworten[$key]['votes'] = number_format($value['votes'], 0, '', '.');
            }
            $tpl->assign('answers', $antworten);
            $tpl->assign('fsurveyID', $thread['fsurveyID']);
            $tpl->assign('id', $id);
            $tpl->assign('bid', $bid);
            $tpl->assign('gesamt', number_format($gesamt, 0, '', '.'));
            if ($umfrage['anzahl'] or isset($_COOKIE['forum']['survey_' . $thread['fsurveyID']]) or !find_access($thread['votesurvey']) or $thread['closed'] or $umfrage['ende'] != 0 and $umfrage['ende'] < time()) {
                $tpl->assign('abstimmen', false);
            } else {
                $tpl->assign('abstimmen', true);
            }
        }
        $tpl->display(DESIGN . '/tpl/forum/board_head.html');
        $tpl->display(DESIGN . '/tpl/forum/thread_comments.html');
        $tpl->display(DESIGN . '/tpl/forum/board_footer.html');
        $content = ob_get_contents();
        ob_end_clean();
        main_content(FORUM, $content, '', 1);
    } else {
        table(ERROR, ACCESS_DENIED);
    }
}
Example #9
0
#            Skype  :  vantuzilla             #
#---------------------------------------------#
require_once '../includes/start.php';
require_once '../includes/functions.php';
require_once '../includes/header.php';
header('Content-type: application/json');
header('Content-Disposition: inline; filename="forum.json";');
$key = !empty($_REQUEST['key']) ? check($_REQUEST['key']) : null;
$id = !empty($_REQUEST['id']) ? abs(intval($_REQUEST['id'])) : null;
if (!empty($key)) {
    $user = DB::run()->queryFetch("SELECT * FROM `users` WHERE `users_apikey`=? LIMIT 1;", array($key));
    if (!empty($user)) {
        $topic = DB::run()->queryFetch("SELECT * FROM `topics` WHERE `topics_id`=? LIMIT 1;", array($id));
        if (!empty($topic)) {
            $querypost = DB::run()->query("SELECT * FROM `posts` WHERE `posts_topics_id`=? ORDER BY `posts_time` ASC;", array($id));
            $posts = $querypost->fetchAll();
            $messages = array();
            foreach ($posts as $post) {
                $post['posts_text'] = bb_code(str_replace('<img src="/images/', '<img src="' . $config['home'] . '/images/', $post['posts_text']));
                $messages[] = array('author' => $post['posts_user'], 'text' => $post['posts_text'], 'time' => $post['posts_time']);
            }
            echo json_encode(array('id' => $topic['topics_id'], 'author' => $topic['topics_author'], 'title' => $topic['topics_title'], 'messages' => $messages));
        } else {
            echo json_encode(array('error' => 'notopic'));
        }
    } else {
        echo json_encode(array('error' => 'nouser'));
    }
} else {
    echo json_encode(array('error' => 'nokey'));
}
Example #10
0
                 $start = 0;
             }
             if ($total < $start + $config['privatpost']) {
                 $end = $total;
             } else {
                 $end = $start + $config['privatpost'];
             }
             for ($i = $start; $i < $end; $i++) {
                 $num = $total - $i - 1;
                 $data = explode("|", $file[$i]);
                 echo '<div class="b">';
                 echo user_avatars($data[0]);
                 echo 'Получатель: <b><a href="anketa.php?uz=' . $data[0] . '&amp;' . SID . '">' . nickname($data[0]) . '</a></b> (' . date_fixed($data[2]) . ')<br />';
                 echo '<input type="checkbox" name="del[]" value="' . $num . '" /> ';
                 echo '<a href="privat.php?action=submit&amp;uz=' . $data[0] . '&amp;' . SID . '">Написать еще</a></div>';
                 echo '<div>Текст письма: ' . bb_code($data[1]) . '</div>';
             }
             echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
             page_jumpnavigation('privat.php?action=output&amp;', $config['privatpost'], $start, $total);
             page_strnavigation('privat.php?action=output&amp;', $config['privatpost'], $start, $total);
             echo '<br /><br /><img src="../images/img/error.gif" alt="image" /> <a href="privat.php?action=alloutdel&amp;uid=' . $_SESSION['token'] . '&amp;' . SID . '">Очистить ящик</a>';
         } else {
             show_error('Отправленных писем еще нет!');
         }
     } else {
         show_error('Отправленных писем еще нет!');
     }
     echo '<br /><img src="../images/img/mail.gif" alt="image" /> <a href="privat.php?action=submit&amp;' . SID . '">Написать письмо</a><br />';
 }
 ############################################################################################
 ##                                   Отправка сообщений                                   ##
Example #11
0
         if (empty($start)) {
             $queryreads = DB::run()->querySingle("SELECT `read_ip` FROM `readblog` WHERE `read_blog`=? AND `read_ip`=? LIMIT 1;", array($id, $ip));
             if (empty($queryreads)) {
                 $expiresread = SITETIME + 3600 * $config['blogexpread'];
                 DB::run()->query("DELETE FROM `readblog` WHERE `read_time`<?;", array(SITETIME));
                 DB::run()->query("INSERT INTO `readblog` (`read_blog`, `read_ip`, `read_time`) VALUES (?, ?, ?);", array($id, $ip, $expiresread));
                 DB::run()->query("UPDATE `blogs` SET `blogs_read`=`blogs_read`+1 WHERE `blogs_id`=? LIMIT 1;", array($id));
             }
         }
         // --------------
         if ($start < 0 || $start >= $total) {
             $start = 0;
         }
         $end = $total < $start + 1 ? $total : $start + 1;
         for ($i = $start; $i < $end; $i++) {
             $blogs['text'] = bb_code($text[$i]) . '<br />';
         }
         $tags = preg_split('/[\\s]*[,][\\s]*/', $blogs['blogs_tags']);
         $arrtags = '';
         foreach ($tags as $key => $value) {
             $comma = empty($key) ? '' : ', ';
             $arrtags .= $comma . '<a href="tags.php?act=search&amp;tags=' . urlencode($value) . '">' . $value . '</a>';
         }
         render('blog/blog_view', array('blogs' => $blogs, 'tags' => $arrtags, 'start' => $start, 'total' => $total));
     } else {
         show_error('Текста статьи еще нет!');
     }
 } else {
     show_error('Ошибка! Данной статьи не существует!');
 }
 render('includes/back', array('link' => 'index.php', 'title' => 'К блогам'));
Example #12
0
            $limits = get_sql_limit($thread['posts'] + 1, LIMIT_FORUM_COMMENTS);
            $result = $db->query('SELECT `comID`, ' . DB_PRE . 'ecp_forum_comments.userID, a.rID, rankname, iconname, `postname`, `adatum`, `comment`, `edits`, `editdatum`, `edituserID`, ' . DB_PRE . 'ecp_forum_comments.IP, `attachs`, a.username, a.sex, a.signatur, a.country, comments, d.money, a.avatar, b.username as editfrom, lastklick as online
								FROM `' . DB_PRE . 'ecp_forum_comments` 
								LEFT JOIN ' . DB_PRE . 'ecp_user as a ON (' . DB_PRE . 'ecp_forum_comments.userID = a.ID)
								LEFT JOIN ' . DB_PRE . 'ecp_user as b ON (' . DB_PRE . 'ecp_forum_comments.edituserID = b.ID)
								LEFT JOIN ' . DB_PRE . 'ecp_user_stats as d ON (' . DB_PRE . 'ecp_forum_comments.userID = d.userID)
								LEFT JOIN ' . DB_PRE . 'ecp_ranks ON (a.rID = rankID)
								LEFT JOIN ' . DB_PRE . 'ecp_online ON (uID = ' . DB_PRE . 'ecp_forum_comments.userID AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ')
								WHERE boardID = ' . $bid . ' AND tID = ' . $id . '
								GROUP BY comID
								ORDER BY adatum ' . (@$_GET['order'] == 'DESC' ? 'DESC' : 'ASC') . '
								LIMIT ' . $limits[1] . ', ' . LIMIT_FORUM_COMMENTS);
            while ($row = mysql_fetch_assoc($result)) {
                $row['adatum'] = forum_make_date($row['adatum']);
                $row['nr'] = ++$limits[1];
                $row['comment'] = bb_code($row['comment']);
                $row['comments'] = format_nr($row['comments']);
                $row['countryname'] = @$countries[$row['country']];
                $row['quote'] = $row['comment'];
                $row['sex'] == 'male' ? $row['sextext'] = MALE : ($row['sextext'] = FEMALE);
                if ($row['edits']) {
                    $row['edit'] = str_replace(array('{anzahl}', '{von}', '{last}'), array($row['edits'], '<a href="?section=user&id=' . $row['edituserID'] . '">' . $row['editfrom'] . '</a>', date(LONG_DATE, $row['editdatum'])), COMMENT_EDIT_TXT);
                }
                if ($row['attachs']) {
                    $anhaenge = array();
                    $db->query('SELECT `attachID`, `name`, `size`, `downloads` FROM `' . DB_PRE . 'ecp_forum_attachments` WHERE `bID` = ' . $bid . ' AND `tID` = ' . $id . ' AND `mID` = ' . $row['comID']);
                    while ($sub = $db->fetch_assoc()) {
                        $sub['size'] = goodsize($sub['size']);
                        $anhaenge[] = $sub;
                    }
                    $row['attchs'] = $anhaenge;
Example #13
0
 $total = DB::run()->querySingle("SELECT count(*) FROM `photo`;");
 if ($total > 0) {
     if ($start >= $total) {
         $start = 0;
     }
     echo '<form action="gallery.php?act=del&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
     $queryphoto = DB::run()->query("SELECT * FROM `photo` ORDER BY `photo_time` DESC LIMIT " . $start . ", " . $config['fotolist'] . ";");
     while ($data = $queryphoto->fetch()) {
         echo '<div class="b">';
         echo '<img src="/images/img/gallery.gif" alt="image" /> ';
         echo '<b><a href="/gallery/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']) . ')<br />';
         echo '<input type="checkbox" name="del[]" value="' . $data['photo_id'] . '" /> <a href="gallery.php?act=edit&amp;start=' . $start . '&amp;gid=' . $data['photo_id'] . '">Редактировать</a>';
         echo '</div>';
         echo '<div><a href="/gallery/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><br />';
         if (!empty($data['photo_text'])) {
             echo bb_code($data['photo_text']) . '<br />';
         }
         echo 'Добавлено: ' . profile($data['photo_user']) . ' (' . date_fixed($data['photo_time']) . ')<br />';
         echo '<a href="/gallery/index.php?act=comments&amp;gid=' . $data['photo_id'] . '">Комментарии</a> (' . $data['photo_comments'] . ') ';
         echo '<a href="/gallery/index.php?act=end&amp;gid=' . $data['photo_id'] . '">&raquo;</a>';
         echo '</div>';
     }
     echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
     page_strnavigation('gallery.php?', $config['fotolist'], $start, $total);
     echo 'Всего фотографий: <b>' . $total . '</b><br /><br />';
 } else {
     show_error('Фотографий еще нет!');
 }
 if (is_admin(array(101))) {
     echo '<img src="/images/img/reload.gif" alt="image" /> <a href="gallery.php?act=restatement&amp;uid=' . $_SESSION['token'] . '">Пересчитать</a><br />';
 }
Example #14
0
 function news_comment_message($comment)
 {
     return stripslashes(bb_code($comment['Comment_Message']));
 }
Example #15
0
    $act = check($_GET['act']);
} else {
    $act = 'index';
}
show_title('Блокнот');
if (is_user()) {
    switch ($act) {
        ############################################################################################
        ##                                    Главная страница                                    ##
        ############################################################################################
        case "index":
            $note = DB::run()->queryFetch("SELECT * FROM `notebook` WHERE `note_user`=? LIMIT 1;", array($log));
            echo 'Здесь вы можете хранить отрывки сообщений или любую другую важную информацию<br /><br />';
            if (!empty($note['note_text'])) {
                echo '<div>Личная запись:<br />';
                echo bb_code($note['note_text']) . '</div><br />';
                echo 'Последнее изменение: ' . date_fixed($note['note_time']) . '<br /><br />';
            } else {
                show_error('Запись пустая или отсутствует!');
            }
            echo '<img src="/images/img/edit.gif" alt="image" /> <a href="notebook.php?act=edit">Редактировать</a><br />';
            break;
            ############################################################################################
            ##                                   Редактирование записи                                ##
            ############################################################################################
        ############################################################################################
        ##                                   Редактирование записи                                ##
        ############################################################################################
        case "edit":
            $note = DB::run()->queryFetch("SELECT * FROM `notebook` WHERE `note_user`=? LIMIT 1;", array($log));
            echo '<div class="form">';
Example #16
0
#            Email  :  visavi.net@mail.ru     #
#             Site  :  http://visavi.net      #
#              ICQ  :  36-44-66               #
#            Skype  :  vantuzilla             #
#---------------------------------------------#
require_once '../includes/start.php';
require_once '../includes/functions.php';
require_once '../includes/header.php';
header("Content-type:application/rss+xml; charset=utf-8");
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel>';
echo '<title>' . $config['title'] . ' News</title>';
echo '<link>' . $config['home'] . '</link>';
echo '<description>Новости RSS - ' . $config['title'] . '</description>';
echo '<image><url>' . $config['logotip'] . '</url>';
echo '<title>' . $config['title'] . ' News</title>';
echo '<link>' . $config['home'] . '</link></image>';
echo '<language>ru</language>';
echo '<copyright>' . $config['copy'] . '</copyright>';
echo '<managingEditor>' . $config['emails'] . ' (' . $config['nickname'] . ')</managingEditor>';
echo '<webMaster>' . $config['emails'] . ' (' . $config['nickname'] . ')</webMaster>';
echo '<lastBuildDate>' . date("r", SITETIME) . '</lastBuildDate>';
$querynews = DB::run()->query("SELECT * FROM `news` ORDER BY `news_id` DESC LIMIT 15;");
while ($data = $querynews->fetch()) {
    $data['news_text'] = bb_code($data['news_text']);
    $data['news_text'] = str_replace(array('/images/smiles', '[cut]'), array($config['home'] . '/images/smiles', ''), $data['news_text']);
    echo '<item><title>' . htmlspecialchars($data['news_title']) . '</title><link>' . $config['home'] . '/news/index.php?act=read&amp;id=' . $data['news_id'] . '</link>';
    echo '<description>' . htmlspecialchars($data['news_text']) . ' </description><author>' . nickname($data['news_author']) . '</author>';
    echo '<pubDate>' . date("r", $data['news_time']) . '</pubDate><category>Новости</category><guid>' . $config['home'] . '/news/index.php?act=read&amp;id=' . $data['news_id'] . '</guid></item>';
}
echo '</channel></rss>';
Example #17
0
     $querywall = DB::run()->query("SELECT * FROM `wall` WHERE `wall_user`=? ORDER BY `wall_time` DESC LIMIT " . $start . ", " . $config['wallpost'] . ";", array($uz));
     while ($data = $querywall->fetch()) {
         echo '<div class="b">';
         echo '<div class="img">' . user_avatars($data['wall_login']) . '</div>';
         if ($is_admin || $uz == $log) {
             echo '<span class="imgright"><input type="checkbox" name="del[]" value="' . $data['wall_id'] . '" /></span>';
         }
         echo '<b>' . profile($data['wall_login']) . '</b> <small>(' . date_fixed($data['wall_time']) . ')</small><br />';
         echo user_title($data['wall_login']) . ' ' . user_online($data['wall_login']) . '</div>';
         if ($uz == $log && $log != $data['wall_login']) {
             echo '<div class="right">';
             echo '<a href="private.php?act=submit&amp;uz=' . $data['wall_login'] . '">Приват</a> / ';
             echo '<a href="wall.php?uz=' . $data['wall_login'] . '">Стена</a> / ';
             echo '<noindex><a href="wall.php?act=spam&amp;id=' . $data['wall_id'] . '&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '" onclick="return confirm(\'Вы подтверждаете факт спама?\')" rel="nofollow">Спам</a></noindex></div>';
         }
         echo '<div>' . bb_code($data['wall_text']) . '</div>';
     }
     if ($is_admin || $uz == $log) {
         echo '<span class="imgright"><input type="submit" value="Удалить выбранное" /></span></form>';
     }
     page_strnavigation('wall.php?uz=' . $uz . '&amp;', $config['wallpost'], $start, $total);
 } else {
     show_error('Записок еще нет!');
 }
 if (is_user()) {
     if (!user_privacy($uz) || $uz == $log || is_admin() || is_contact($uz, $log)) {
         echo '<div class="form">';
         echo '<form action="wall.php?act=add&amp;uz=' . $uz . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
         echo 'Сообщение:<br />';
         echo '<textarea cols="25" rows="5" name="msg"></textarea><br />';
         echo '<input type="submit" value="Написать" /></form></div><br />';
Example #18
0
         echo '<div class="b"><b>Дополнительная информация</b></div>';
         if ($user['users_confirmreg'] == 1) {
             echo '<span style="color:#ff0000"><b>Аккаунт не активирован</b></span><br />';
         }
         $visit = DB::run()->queryFetch("SELECT `visit_ip`, `visit_nowtime` FROM `visit` WHERE `visit_user`=? LIMIT 1;", array($uz));
         if (!empty($visit)) {
             echo '<b>Последний визит:</b> ' . date_fixed($visit['visit_nowtime'], 'j F Y / H:i') . '<br />';
             echo '<b>Последний IP:</b> ' . $visit['visit_ip'] . '<br />';
         }
         if ($user['users_ban'] == 1 && $user['users_timeban'] > SITETIME) {
             echo '<span style="color:#ff0000"><b>Пользователь забанен</b></span><br />';
         }
         if (!empty($user['users_timelastban']) && !empty($user['users_reasonban'])) {
             echo '<div class="form">';
             echo 'Последний бан: ' . date_fixed($user['users_timelastban'], 'j F Y / H:i') . '<br />';
             echo 'Последняя причина: ' . bb_code($user['users_reasonban']) . '<br />';
             echo 'Забанил: ' . profile($user['users_loginsendban']) . '</div>';
         }
         echo 'Строгих банов: <b>' . $user['users_totalban'] . '</b><br /><br />';
         if ($user['users_level'] < 101 || $user['users_level'] > 105) {
             echo '<img src="/images/img/error.gif" alt="image" /> <b><a href="users.php?act=poddel&amp;uz=' . $uz . '">Удалить профиль</a></b><br />';
         }
     } else {
         show_error('Ошибка! У вас недостаточно прав для редактирования этого профиля!');
     }
 } else {
     show_error('Ошибка! Пользователя с данным логином не существует!');
 }
 echo '<img src="/images/img/back.gif" alt="image" /> <a href="users.php">Вернуться</a><br />';
 break;
 ############################################################################################
Example #19
0
function news_once($id)
{
    global $db;
    $anzahl = $db->result(DB_PRE . 'ecp_news', 'COUNT(newsID)', '(lang = "" OR lang LIKE ",%' . LANGUAGE . '%,") AND ' . DB_PRE . 'ecp_news.datum < ' . time() . ' AND (access = "" OR ' . $_SESSION['access_search'] . ') AND newsID = ' . $id);
    if (!isset($_SESSION['news'][(int) $_GET['id']])) {
        if ($db->query('UPDATE ' . DB_PRE . 'ecp_news SET hits = hits + 1 WHERE newsID = ' . (int) $_GET['id'])) {
            $_SESSION['news'][(int) $_GET['id']] = true;
        }
    }
    $sql = 'SELECT `newsID`, `' . DB_PRE . 'ecp_news`.`userID`, `topicID`, `' . DB_PRE . 'ecp_news`.`datum`, `headline`, `bodytext`, `extendtext`, `links`, `hits`,
							  `username`, `topicname`, `topicbild`, `beschreibung`
						FROM ' . DB_PRE . 'ecp_news 
						LEFT JOIN ' . DB_PRE . 'ecp_user ON (' . DB_PRE . 'ecp_news.userID = ID)  
						LEFT JOIN ' . DB_PRE . 'ecp_topics ON (topicID = tID) 
						WHERE (lang = "" OR lang LIKE ",%' . LANGUAGE . '%,") AND ' . DB_PRE . 'ecp_news.datum < ' . time() . ' AND (access = "" OR ' . $_SESSION['access_search'] . ') AND newsID = ' . $id . ' GROUP BY newsID';
    if ($anzahl) {
        $db->query($sql);
        while ($row = $db->fetch_assoc()) {
            $tpl = new smarty();
            $tpl->assign('comment', 1);
            $row['bodytext'] = bb_code($row['bodytext']);
            $row['extendtext'] = bb_code($row['extendtext']);
            $row['datum'] = date(LONG_DATE, $row['datum']);
            $row['links'] = news_links($row['links']);
            foreach ($row as $key => $value) {
                $tpl->assign($key, $value);
            }
            $tpl->assign('pic', file_exists('templates/' . DESIGN . '/images/topics/' . $row['topicbild']) ? 'templates/' . DESIGN . '/images/topics/' . $row['topicbild'] : 'images/topics/' . $row['topicbild']);
            ob_start();
            $tpl->display(DESIGN . '/tpl/news/news.html');
            $content = ob_get_contents();
            ob_end_clean();
            main_content('<a href="?section=news&amp;action=topic&amp;id=' . $row['topicID'] . '">' . $row['topicname'] . '</a>: ' . $row['headline'], $content, '', 0);
        }
    } else {
        table(INFO, NO_ENTRIES_ID);
    }
}
Example #20
0
        ?>
&amp;pid=<?php 
        echo $data['commblog_id'];
        ?>
&amp;start=<?php 
        echo $start;
        ?>
">Редактировать</a>
			</div>
		<?php 
    }
    ?>

		<div>
			<?php 
    echo bb_code($data['commblog_text']);
    ?>
<br />

		<?php 
    if (is_admin() || empty($config['anonymity'])) {
        ?>
			<span class="data">(<?php 
        echo $data['commblog_brow'];
        ?>
, <?php 
        echo $data['commblog_ip'];
        ?>
)</span>
		<?php 
    }
Example #21
0
function comments_get($bereich, $id, $conditions, $ajax = 0, $border = 1, $session = '')
{
    global $db, $countries;
    $id = (int) $id;
    $bereich = strsave($bereich);
    if (@$_SESSION['rights']['public'][$session ? $session : $bereich]['com_view'] or @$_SESSION['rights']['superadmin']) {
        $anzahl = $db->result(DB_PRE . 'ecp_comments', 'COUNT(comID)', 'bereich = \'' . $bereich . '\' AND subID = ' . $id);
        if ($anzahl) {
            $seiten = get_sql_limit($anzahl, $conditions['LIMIT']);
            $db->query('SELECT
		                     a.username, a.registerdate, a.rID, rankname, iconname, author, c.homepage, c.email, comID, c.userID, a.country, a.sex, beitrag, datum, editdatum, editby, edits, lastklick, a.avatar, a.signatur, comments, b.username as editfrom, uID as online
		                 FROM
		                     ' . DB_PRE . 'ecp_comments as c
						LEFT JOIN ' . DB_PRE . 'ecp_user as a ON (c.userID = a.ID)
						LEFT JOIN ' . DB_PRE . 'ecp_user as b ON (c.editby = b.ID)
						LEFT JOIN ' . DB_PRE . 'ecp_user_stats ON (c.userID = ' . DB_PRE . 'ecp_user_stats.userID)
						LEFT JOIN ' . DB_PRE . 'ecp_ranks ON (a.rID = rankID)
						LEFT JOIN ' . DB_PRE . 'ecp_online ON (uID = c.userID AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ')
		                 WHERE
		                     subID = ' . $id . ' AND bereich = "' . $bereich . '"
		                 GROUP BY comID
		                 ORDER BY
		                     datum ' . $conditions['ORDER'] . '
		                 LIMIT ' . $seiten[1] . ',' . $conditions['LIMIT']);
            $comments = array();
            while ($row = $db->fetch_assoc()) {
                $row['nr'] = ++$seiten[1];
                $row['comments'] = format_nr($row['comments']);
                $row['countryname'] = @$countries[$row['country']];
                $row['sex'] == 'male' ? $row['sextext'] = MALE : ($row['sextext'] = FEMALE);
                if ($row['edits']) {
                    $row['edit'] = str_replace(array('{anzahl}', '{von}', '{last}'), array($row['edits'], '<a href="?section=user&id=' . $row['editby'] . '">' . $row['editfrom'] . '</a>', date(LONG_DATE, $row['editdatum'])), COMMENT_EDIT_TXT);
                }
                $row['datum'] = date(LONG_DATE, $row['datum']);
                $row['quote'] = $row['beitrag'];
                $row['beitrag'] = bb_code($row['beitrag']);
                $comments[] = $row;
            }
            $tpl = new smarty();
            $tpl->assign('id', $id);
            $tpl->assign('link', $conditions['link']);
            $tpl->assign('section', $conditions['section']);
            if ($seiten[0] > 1) {
                $tpl->assign('seiten', makepagelink_ajax($conditions['link'], 'return load_com_page(\'' . $bereich . '\', ' . $id . ', {nr});', @$_GET['page'], $seiten[0]));
            }
            $tpl->assign('comments', $comments);
            $tpl->assign('bereich', $bereich);
            $tpl->assign('bereich2', $session ? $session : $bereich);
            $tpl->assign('ajax', $ajax);
            if ($ajax) {
                ob_start();
                $tpl->display(DESIGN . '/tpl/comments.html');
                $db->close();
                $content = ob_get_contents();
                ob_end_clean();
                echo html_ajax_convert($content);
                die;
            }
            if ($border) {
                ob_start();
                $tpl->display(DESIGN . '/tpl/comments.html');
                $content = ob_get_contents();
                ob_end_clean();
                main_content(COMMENTS, $content, '', 1);
            } else {
                $tpl->display(DESIGN . '/tpl/comments.html');
            }
        } else {
            if (!$ajax) {
                table(COMMENTS, '<div id="comments_bereich">' . NO_ENTRIES . '</div>');
            } else {
                echo html_ajax_convert(NO_ENTRIES);
            }
        }
        if ((@$_SESSION['rights']['public'][$session ? $session : $bereich]['com_add'] or @$_SESSION['rights']['superadmin']) and !$ajax) {
            $tplc = new smarty();
            $tplc->assign('section', $conditions['section'] ? $conditions['section'] : $bereich);
            $tplc->assign('action', $conditions['action']);
            $tplc->assign('id', $id);
            if ($border) {
                ob_start();
                $tplc->display(DESIGN . '/tpl/comment_add_edit.html');
                $content = ob_get_contents();
                ob_end_clean();
                main_content(ADD_COMMENT, $content, '', 1);
            } else {
                $tplc->display(DESIGN . '/tpl/comment_add_edit.html');
            }
        } elseif (!$ajax) {
            table(ACCESS_DENIED, NO_RIGHTS_ADD_COMMENT);
        }
    } else {
        table(ACCESS_DENIED, NO_RIGHTS_READ_COMMENT);
    }
}
Example #22
0
 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']) {
                     echo 'Проверочный код:<br /> ';
                     echo '<img src="/gallery/protect.php" alt="" /><br />';
                     echo '<input name="provkod" size="6" maxlength="6" /><br />';
                 }
                 echo '<input value="Быстрый ответ" type="submit" /></form></div><br />';
             } else {
                 show_error('Включен режим приватности, писать могут только пользователи из контактов!');
Example #23
0
show_title('partners.gif', 'Новости сайта');
$file = file(DATADIR . "news.dat");
$file = array_reverse($file);
$total = count($file);
if ($total > 0) {
    if ($start < 0 || $start > $total) {
        $start = 0;
    }
    if ($total < $start + $config['postnews']) {
        $end = $total;
    } else {
        $end = $start + $config['postnews'];
    }
    for ($i = $start; $i < $end; $i++) {
        $data = explode("|", $file[$i]);
        echo '<div class="b"><img src="../images/img/files.gif" alt="image" /> ';
        echo '<b>' . $data[0] . '</b><small> (' . date_fixed($data[3]) . ')</small></div>';
        echo '<div>' . bb_code($data[1]) . '<br />';
        echo 'Разместил: <a href="../pages/anketa.php?uz=' . $data[4] . '&amp;' . SID . '"> ' . nickname($data[4]) . ' </a><br />';
        echo '<a href="komm.php?id=' . (int) $data[5] . '&amp;' . SID . '">Комментарии</a> ';
        $countkomm = counter_string(DATADIR . "datakomm/{$data['5']}.dat");
        echo '(' . (int) $countkomm . ')</div>';
    }
    page_jumpnavigation('index.php?', $config['postnews'], $start, $total);
    page_strnavigation('index.php?', $config['postnews'], $start, $total);
} else {
    show_error('Новостей еще нет!');
}
echo '<br /><br /><img src="../images/img/rss.gif" alt="image" /> <a href="rss.php?' . SID . '">RSS подписка</a><br />';
echo '<img src="../images/img/homepage.gif" alt="image" /> <a href="../index.php?' . SID . '">На главную</a>';
include_once "../themes/" . $config['themes'] . "/foot.php";
Example #24
0
 ############################################################################################
 case 'comments':
     show_title('Список последних комментариев');
     $total = DB::run()->querySingle("SELECT count(*) FROM `commload`;");
     if ($total > 0) {
         if ($total > 100) {
             $total = 100;
         }
         if ($start >= $total) {
             $start = 0;
         }
         $querydown = DB::run()->query("SELECT `commload`.*, `downs_title`, `downs_comments` FROM `commload` LEFT JOIN `downs` ON `commload`.`commload_down`=`downs`.`downs_id` ORDER BY `commload_time` DESC LIMIT " . $start . ", " . $config['downlist'] . ";");
         while ($data = $querydown->fetch()) {
             echo '<div class="b">';
             echo '<img src="/images/img/balloon.gif" alt="image" /> <b><a href="new.php?act=viewcomm&amp;id=' . $data['commload_down'] . '&amp;cid=' . $data['commload_id'] . '">' . $data['downs_title'] . '</a></b> (' . $data['downs_comments'] . ')</div>';
             echo '<div>' . bb_code($data['commload_text']) . '<br />';
             echo 'Написал: ' . profile($data['commload_author']) . ' <small>(' . date_fixed($data['commload_time']) . ')</small><br />';
             if (is_admin() || empty($config['anonymity'])) {
                 echo '<span class="data">(' . $data['commload_brow'] . ', ' . $data['commload_ip'] . ')</span>';
             }
             echo '</div>';
         }
         page_strnavigation('new.php?act=comments&amp;', $config['downlist'], $start, $total);
     } else {
         show_error('Комментарии не найдены!');
     }
     break;
     ############################################################################################
     ##                                     Переход к сообщение                                ##
     ############################################################################################
 ############################################################################################
Example #25
0
                            }
                        } else {
                            show_error('Ошибка! Вы уже писали объяснение!');
                        }
                    } else {
                        show_error('Ошибка! Писать объяснительные запрещено админом!');
                    }
                    echo '<img src="/images/img/back.gif" alt="image" /> <a href="ban.php">Вернуться</a><br />';
                    break;
                default:
                    redirect("ban.php");
            }
            ############################################################################################
            ##                                    Конец бана                                          ##
            ############################################################################################
        } else {
            echo '<img src="/images/img/open.gif" alt="image" /> <b>Срок бана закончился!</b><br /><br />';
            echo '<b><span style="color:#ff0000">Причина бана: ' . bb_code($udata['users_reasonban']) . '</span></b><br /><br />';
            echo 'Поздравляем!!! Время вашего бана вышло, постарайтесь вести себя достойно и не нарушать правила сайта<br /><br />';
            echo 'Рекомендуем ознакомиться с <b><a href="/pages/rules.php">Правилами сайта</a></b><br />';
            echo 'Также у вас есть возможность исправиться и снять строгое нарушение.<br />';
            echo 'Если прошло более 1 месяца после последнего бана, то на странице <b><a href="/pages/razban.php">Исправительная</a></b> заплатив штраф вы можете снять 1 строгое нарушение<br /><br />';
            DB::run()->query("UPDATE `users` SET `users_ban`=?, `users_timeban`=?, `users_explainban`=? WHERE `users_login`=?;", array(0, 0, 0, $log));
        }
    } else {
        show_error('Ошибка! Вы не забанены или срок бана истек!');
    }
} else {
    show_error('Ошибка! Вы не авторизованы!');
}
include_once '../themes/footer.php';
Example #26
0
     $is_admin = is_admin(array(101, 102, 103, 105));
     if ($is_admin) {
         echo '<form action="index.php?action=del&amp;gid=' . $gid . '&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '&amp;' . SID . '" method="post">';
     }
     if ($start < 0 || $start >= $total) {
         $start = 0;
     }
     if ($total < $start + $config['postgallery']) {
         $end = $total;
     } else {
         $end = $start + $config['postgallery'];
     }
     for ($i = $start; $i < $end; $i++) {
         $data = explode("|", $file[$i]);
         $num = $total - $i - 1;
         $data[0] = bb_code($data[0]);
         echo '<div class="b"> ';
         if ($is_admin) {
             echo '<input type="checkbox" name="del[]" value="' . $num . '" /> ';
         }
         echo user_avatars($data[3]);
         echo '<b><a href="../pages/anketa.php?uz=' . $data[3] . '&amp;' . SID . '"> ' . nickname($data[3]) . ' </a></b> ' . user_title($data[3]) . user_online($data[3]);
         echo '<small> (' . date_fixed($data[2]) . ')</small></div>';
         echo '<div>' . $data[0] . '</div>';
     }
     if ($is_admin) {
         echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
     }
     page_jumpnavigation('index.php?action=komm&amp;gid=' . $gid . '&amp;', $config['postgallery'], $start, $total);
     page_strnavigation('index.php?action=komm&amp;gid=' . $gid . '&amp;', $config['postgallery'], $start, $total);
 } else {
Example #27
0
 $totalload = DB::run()->querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(5));
 echo '<a href="spam.php?act=forum">Форум (' . $totalforum . ')</a> / <a href="spam.php?act=guest">Гостевая</a> (' . $totalguest . ') / <a href="spam.php?act=privat">Приват</a> (' . $totalpriv . ') / <a href="spam.php?act=wall">Стена</a> (' . $totalwall . ') / <a href="spam.php?act=load">Загрузки</a> (' . $totalload . ') / <b>Блоги</b> (' . $total . ')<br /><br />';
 if ($total > 0) {
     if ($start >= $total) {
         $start = 0;
     }
     $queryban = DB::run()->query("SELECT * FROM `spam` WHERE `spam_key`=? ORDER BY `spam_addtime` DESC LIMIT " . $start . ", " . $config['spamlist'] . ";", array(6));
     echo '<form action="spam.php?act=del&amp;ref=blog&amp;start=' . $start . '&amp;uid=' . $_SESSION['token'] . '" method="post">';
     echo '<div class="form">';
     echo '<input type="checkbox" id="all" onchange="var o=this.form.elements;for(var i=0;i&lt;o.length;i++)o[i].checked=this.checked" /> <b><label for="all">Отметить все</label></b>';
     echo '</div>';
     while ($data = $queryban->fetch()) {
         echo '<div class="b">';
         echo '<input type="checkbox" name="del[]" value="' . $data['spam_id'] . '" /> ';
         echo '<img src="/images/img/files.gif" alt="image" /> <b>' . profile($data['spam_login']) . '</b> <small>(' . date_fixed($data['spam_time'], "d.m.y / H:i:s") . ')</small></div>';
         echo '<div>Сообщение: ' . bb_code($data['spam_text']) . '<br />';
         echo '<a href="' . $data['spam_link'] . '">Перейти к сообщению</a><br />';
         echo 'Жалоба: ' . profile($data['spam_user']) . ' (' . date_fixed($data['spam_addtime']) . ')</div>';
     }
     echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
     page_strnavigation('spam.php?act=blog&amp;', $config['spamlist'], $start, $total);
     if (is_admin(array(101, 102))) {
         echo '<img src="/images/img/error.gif" alt="image" /> <a href="spam.php?act=clear&amp;uid=' . $_SESSION['token'] . '">Очистить</a><br />';
     }
 } else {
     show_error('Жалоб еще нет!');
 }
 break;
 ############################################################################################
 ##                                 Удаление сообщений                                     ##
 ############################################################################################
Example #28
0
                    }
                }
            }
            echo "</table>";
            echo '<p>';
            echo '<a href="' . get_link('Mailbox', 'User', array("Write" => "mail")) . '">' . LanguageValidation::nMsg("btn.message.write") . '</a>';
            echo '</p>';
            if (empty($Private_Message_ID)) {
                echo 'Vous n\'avez aucun nouveau message';
            }
        } else {
            //Si l'utilisateur souhaite repondre à un message
            if (request_confirm('Reply')) {
                $Conversation = request_post('Private_Message_Conversation') == 0 ? request_post('Private_Message_ID') : request_post('Private_Message_Conversation');
                $Receiver = htmlspecialchars(addslashes($_POST['Transmitter']));
                $Message_Subject = htmlspecialchars(addslashes($_POST['Message_Subject']));
                $Message = htmlspecialchars(addslashes($_POST['Message']));
                echo LanguageValidation::iMsg("intro.message.reply");
                echo formulaire_input(array(text_input("label.message.reply", "Receiver", $Receiver, null, null, "placeholder.message.reply", null, true), text_input("label.message.subject", "Message_Subject", "Re : {$Message_Subject}", null, null, "placeholder.message.subject", null, true), call_bbcode_editor("Message"), submit_input("Send", "btn.message.send")), "Mailbox-Send", get_link('Mailbox', 'User'), "post", null);
                echo bb_code($Message);
            } else {
                echo LanguageValidation::iMsg("intro.private.message");
                echo '<p>';
                echo '<a href="' . get_link('Mailbox', 'User', array("Write" => "mail")) . '">' . LanguageValidation::nMsg("btn.message.write") . '</a>';
                echo ' - ';
                echo '<a href="' . get_link('Mailbox', 'User', array("Read" => "box")) . '">' . LanguageValidation::nMsg("btn.message.read") . '</a>';
                echo '</p>';
            }
        }
    }
}
Example #29
0
                 $useronline = '<span style="color:#00ff00">[On]</span>';
             }
             if ($data[1] == 'Настюха') {
                 $useravatars = '<img src="../images/img/bot.gif" alt="image" /> ';
                 $useronline = '<span style="color:#00ff00">[On]</span>';
             }
             if ($data[1] == 'Весальчак') {
                 $useravatars = '<img src="../images/img/shut.gif" alt="image" /> ';
                 $useronline = '<span style="color:#00ff00">[On]</span>';
             }
             echo '<div class="b">';
             echo $useravatars;
             echo '<b><a href="../pages/anketa.php?uz=' . $data[1] . '&amp;' . SID . '"> ' . nickname($data[1]) . '</a></b> ' . user_title($data[1]) . $useronline . ' <small> (' . date_fixed($data[3]) . ')</small><br />';
             echo '<input type="checkbox" name="del[]" value="' . $num . '" /> ';
             echo '<a href="chat.php?action=edit&amp;id=' . $num . '&amp;start=' . $start . '&amp;' . SID . '">Редактировать</a>';
             echo '</div><div>' . bb_code($data[0]) . '<br />';
             echo '<span style="color:#cc00cc"><small>(' . $data[4] . ', ' . $data[5] . ')</small></span></div>';
         }
         echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
         page_jumpnavigation('chat.php?', $config['chatpost'], $start, $total);
         page_strnavigation('chat.php?', $config['chatpost'], $start, $total);
         echo '<br /><br />Всего сообщений: <b>' . (int) $total . '</b><br />';
         if (is_admin(array(101))) {
             echo '<br /><img src="../images/img/error.gif" alt="image" /> <a href="chat.php?action=prodel&amp;' . SID . '">Очистить</a><br />';
             echo '<img src="../images/img/reload.gif" alt="image" /> <a href="chat.php?action=restatement&amp;uid=' . $_SESSION['token'] . '&amp;' . SID . '">Пересчитать</a>';
         }
     } else {
         echo '<img src="../images/img/reload.gif" alt="image" />  <b>Сообщений еще нет!</b><br />';
     }
 }
 ############################################################################################
Example #30
0
    ?>

	<div>
		<a href="/upload/pictures/<?php 
    echo $photo['photo_link'];
    ?>
"><img  class="img-responsive" src="/upload/pictures/<?php 
    echo $photo['photo_link'];
    ?>
" alt="image" /></a><br />

		<?php 
    if (!empty($photo['photo_text'])) {
        ?>
			<?php 
        echo bb_code($photo['photo_text']);
        ?>
<br />
		<?php 
    }
    ?>

		Рейтинг: <a href="index.php?act=vote&amp;gid=<?php 
    echo $photo['photo_id'];
    ?>
&amp;vote=down&amp;uid=<?php 
    echo $_SESSION['token'];
    ?>
"><img src="/images/img/thumb-down.gif" alt="Минус" /></a> <big><b><?php 
    echo format_num($photo['photo_rating']);
    ?>