Пример #1
0
function render_single_comment($comment, $userID = null, $isReturn = false)
{
    global $TNB_GLOBALS;
    $timeOffset = 0;
    if (buckys_not_null($userID)) {
        $userInfo = BuckysUser::getUserBasicInfo($userID);
        $timeOffset = $TNB_GLOBALS['timezone'][$userInfo['timezone']];
    }
    ob_start();
    ?>
    <div class="comment-item">
        <a href="/profile.php?user=<?php 
    echo $comment['commenter'];
    ?>
" class="thumb"><img
                src="<?php 
    echo BuckysUser::getProfileIcon($comment['commenter']);
    ?>
" class="replyToPostIcons"/></a>

        <div class="comment-content">
            <a href="/profile.php?user=<?php 
    echo $comment['commenter'];
    ?>
"
                style="font-weight:bold"><?php 
    echo $comment['fullName'];
    ?>
</a><br/>

            <?php 
    if ($comment['content']) {
        ?>
                <?php 
        echo $comment['content'];
        ?>
<br/>
            <?php 
    }
    ?>

            <?php 
    if ($comment['image']) {
        ?>
                <a href="/photos/users/<?php 
        echo $comment['commenter'];
        ?>
/original/<?php 
        echo $comment['image'];
        ?>
"
                    target="_blank"><img
                        src="/photos/users/<?php 
        echo $comment['commenter'];
        ?>
/resized/<?php 
        echo $comment['image'];
        ?>
"/></a>
                <br/>
            <?php 
    }
    ?>

            <span class="comment-date"><?php 
    echo buckys_format_date($comment['posted_date']);
    ?>
</span>

            <?php 
    if ($comment['commenter'] == $userID || $comment['poster'] == $userID) {
        ?>
                &middot;
                <a href="/comments.php?action=delete-comment&userID=<?php 
        echo $userID;
        ?>
&commentID=<?php 
        echo $comment['commentID'];
        ?>
&postID=<?php 
        echo $comment['postID'];
        echo buckys_get_token_param();
        ?>
"
                    class="remove-comment-link">Delete</a>
            <?php 
    }
    if (buckys_not_null($userID) && !$comment['reportID'] && ($comment['commenter'] != $userID && $comment['poster'] != $userID)) {
        ?>
                &middot;
                <a href="/report_object.php" data-type="comment" data-id="<?php 
        echo $comment['commentID'];
        ?>
"
                    data-idHash="<?php 
        echo buckys_encrypt_id($comment['commentID']);
        ?>
" class="report-link"
                    style="color:#999999;">Report</a>
            <?php 
    }
    ?>
            <?php 
    if (buckys_check_user_acl(USER_ACL_MODERATOR)) {
        ?>
                <?php 
        if ($reportID = BuckysReport::isReported($comment['commentID'], 'comment')) {
            ?>
                    &middot;
                    <span class="moderator-action-links">
                    <a href="/reported.php?action=delete-objects&reportID=<?php 
            echo $reportID;
            ?>
">Delete Comment</a>
                        &middot;
                        <a href="/reported.php?action=approve-objects&reportID=<?php 
            echo $reportID;
            ?>
">Approve Comment</a>
                        &middot;
                        <a href="/reported.php?action=ban-users&reportID=<?php 
            echo $reportID;
            ?>
">Ban User</a>
                </span>
                <?php 
        }
        ?>
            <?php 
    }
    ?>
        </div>
    </div>
    <?php 
    $html = ob_get_contents();
    ob_end_clean();
    if (!$isReturn) {
        echo $html;
    } else {
        return $html;
    }
}
Пример #2
0
    buckys_redirect('/forum');
}
$orderBy = isset($_GET['orderby']) ? buckys_escape_query_string($_GET['orderby']) : 'oldest';
//Getting Replies
$page = isset($_GET['page']) ? buckys_escape_query_integer($_GET['page']) : 1;
$total = BuckysForumReply::getTotalNumOfReplies($topic['topicID'], 'publish');
$pagination = new Pagination($total, BuckysForumReply::$COUNT_PER_PAGE, $page);
$page = $pagination->getCurrentPage();
$replies = BuckysForumReply::getReplies($topic['topicID'], 'publish', $page, $orderBy);
$hierarchical = BuckysForumCategory::getCategoryHierarchical($topic['categoryID']);
//Mark Forum Notifications to read
if (buckys_check_user_acl(USER_ACL_REGISTERED)) {
    BuckysForumNotification::makeNotificationsToRead($TNB_GLOBALS['user']['userID'], null, $topic['topicID']);
}
if (buckys_check_user_acl(USER_ACL_MODERATOR)) {
    $reportID = BuckysReport::isReported($topicID, 'topic');
    $categories = BuckysForumCategory::getAllCategories();
}
buckys_enqueue_javascript('sceditor/jquery.sceditor.bbcode.js');
buckys_enqueue_javascript('uploadify/jquery.uploadify.js');
buckys_enqueue_javascript('highlight.pack.js');
buckys_enqueue_javascript('forum.js');
buckys_enqueue_stylesheet('sceditor/themes/default.css');
buckys_enqueue_stylesheet('obsidian.css');
buckys_enqueue_stylesheet('forum.css');
buckys_enqueue_stylesheet('publisher.css');
buckys_enqueue_stylesheet('uploadify.css');
$TNB_GLOBALS['headerType'] = 'forum';
$TNB_GLOBALS['content'] = 'forum/topic';
$TNB_GLOBALS['title'] = $topic['topicTitle'] . ' - thenewboston Forum';
require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
    if ($_POST['action'] == 'delete_forever') {
        if (!BuckysMessage::deleteMessagesForever($_POST['messageID'])) {
            buckys_redirect('/messages_inbox.php', "Error: " . $db->getLastError(), MSG_TYPE_ERROR);
        } else {
            buckys_redirect('/messages_inbox.php', MSG_MESSAGE_REMOVED, MSG_TYPE_SUCCESS);
        }
        exit;
    }
}
$messageID = buckys_escape_query_integer(isset($_GET['message']) ? $_GET['message'] : null);
if (!$messageID) {
    buckys_redirect('/messages_inbox.php');
}
$message = BuckysMessage::getMessage($messageID);
//If the current user is morderator and this message has been reported
if (!$message && buckys_check_user_acl(USER_ACL_MODERATOR) && BuckysReport::isReported($messageID, 'message')) {
    //Getting Message
    $message = BuckysMessage::getMessageById($messageID);
    $msgType = 'reported';
}
if (!$message) {
    buckys_redirect('/messages_inbox.php');
}
if (!isset($msgType)) {
    //Make Message as read
    BuckysMessage::changeMessageStatus($message['messageID'], 'read');
    //Getting Next Message ID and Prev Message ID
    if ($message['is_trash'] == 1) {
        $msgType = 'trash';
    } else {
        if ($message['receiver'] == $userID) {