Exemple #1
0
    }
} else {
    die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "';</script>");
}
// Start Page
$PAGE_NAME = $newsInfo['postsubject'] . " - News - ";
$dispBreadCrumb = "";
include $prevFolder . "themes/" . $THEME . "/_header.php";
$memberInfo = "";
if (!$LOGIN_FAIL) {
    $memberInfo = $member->get_info_filtered();
}
$breadcrumbObj->setTitle("News");
$breadcrumbObj->addCrumb("Home", $MAIN_ROOT);
$breadcrumbObj->addCrumb("News", $MAIN_ROOT . "news");
$breadcrumbObj->addCrumb($newsInfo['postsubject']);
include $prevFolder . "include/breadcrumb.php";
$newsObj->show();
echo "\n\t<div style='padding-left: 15px'>\n\t";
$postCommentCID = $consoleObj->findConsoleIDByName("Post Comment");
$consoleObj->select($postCommentCID);
if ($member->select($memberInfo['member_id'])) {
    if ($member->hasAccess($consoleObj)) {
        echo "\n\t\n\t\t<p class='main' style='font-weight: bold; padding: 0px; margin-bottom: 2px'>Post Comment:</p>\n\t\t<textarea class='textBox' id='commenttext' style='width: 95%; height: 80px'></textarea>\n\t\t<p align='right' style='padding: 0px; margin-top: 5px; padding-right: 25px'><input type='button' class='submitButton' id='postcomment' value='Post'></p>\n\t\n\t\t<script type='text/javascript'>\n\t\t\n\t\t\t\$(document).ready(function() {\n\t\t\t\n\t\t\t\t\$('#postcomment').click(function() {\n\t\t\t\t\n\t\t\t\t\t\$('#commentsDiv').hide();\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/news/postcomment.php', { nID: " . $newsInfo['news_id'] . ", comment: \$('#commenttext').val() }, function(data) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\$('#commentsDiv').html(data);\n\t\t\t\t\t\t\$('#commentsDiv').fadeIn(250);\n\t\t\t\t\t\t\$('#commenttext').val('');\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t});\n\t\t\n\t\t\n\t\t\tfunction deleteComment(intCommentID) {\n\t\t\t\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\n\t\t\t\t\t\$('#commentsDiv').hide();\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/news/deletecomment.php', { commentID: intCommentID }, function(data) {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\$('#commentsDiv').html(data);\n\t\t\t\t\t\t\$('#commentsDiv').fadeIn(250);\n\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t</script>\n\t\t\n\t\t";
    }
}
echo "\n\t\t<p class='largeFont' style='font-weight: bold; padding-bottom: 0px; margin-bottom: 2px'>Comments (<span id='commentCount'>" . $newsObj->countComments() . "</span>)<a name='comments'></a></p>\n\t\t<div class='dottedLine' style='width: 95%'></div>\n\n\t\t<div id='loadingSpiral' class='loadingSpiral'>\n\t\t\t<p align='center'>\n\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral.gif'><br>Loading\n\t\t\t</p>\n\t\t</div>\n\t\t";
$arrComments = $newsObj->getComments();
include "comments.php";
echo "</div>";
include $prevFolder . "themes/" . $THEME . "/_footer.php";
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../_setup.php";
include_once "../../../classes/member.php";
include_once "../../../classes/rank.php";
include_once "../../../classes/news.php";
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage News");
$consoleObj->select($cID);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$memberInfo = $member->get_info_filtered();
$commentObj = new Basic($mysqli, "comments", "comment_id");
$newsObj = new News($mysqli);
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj) && $commentObj->select($_POST['commentID'])) {
    $commentInfo = $commentObj->get_info_filtered();
    $newsObj->select($commentInfo['news_id']);
    $newsInfo = $newsObj->get_info_filtered();
    $member->select($commentInfo['member_id']);
    $posterInfo = $member->get_info_filtered();
    $logMessage = "Deleted comment by " . $member->getMemberLink() . " on news post: <b><a href='" . $MAIN_ROOT . "news/viewpost.php?nID=" . $newsInfo['news_id'] . "'>" . $newsInfo['postsubject'] . "</a></b>";
    $member->select($memberInfo['member_id']);
    $member->logAction($logMessage);
    $commentObj->delete();
    $arrComments = $newsObj->getComments();
    $commentCount = $newsObj->countComments();
}
include "../../../news/comments.php";
echo "\n\t<script type='text/javascript'>\n\t\t\$(document).ready(function() {\n\t\t\t\$('#commentCount').html('" . $commentCount . "');\n\t\t});\n\t</script>\n";
Exemple #3
0
        $posterInfo = $member->get_info_filtered();
        if ($posterInfo['avatar'] == "") {
            $posterInfo['avatar'] = $MAIN_ROOT . "themes/" . $THEME . "/images/defaultavatar.png";
        }
        $dispNewsType = " - <span class='publicNewsColor' style='font-style: italic'>public</span>";
        $dispLastEdit = "";
        if ($member->select($newsInfo['lasteditmember_id'])) {
            $dispLastEditTime = getPreciseTime($newsInfo['lasteditdate']);
            $dispLastEdit = "<span style='font-style: italic'>last edited by " . $member->getMemberLink() . " - " . $dispLastEditTime . "</span>";
        }
        $member->select($newsInfo['member_id']);
        if (!isset($checkHTMLAccess)) {
            $checkHTMLAccess = $member->hasAccess($checkHTMLConsoleObj);
        }
        $dispNews = $checkHTMLAccess ? parseBBCode($newsObj->get_info("newspost")) : nl2br(parseBBCode(filterText($newsInfo['newspost'])));
        $dispHPNews .= "\t\t\n\t\t\t<div class='newsDiv' id='newsDiv_" . $newsInfo['news_id'] . "'>\n\t\t\t\t<div class='postInfo'>\n\t\t\t\t\t<div id='newsPostAvatar' style='float: left'><img src='" . $posterInfo['avatar'] . "' class='avatarImg'></div>\n\t\t\t\t\t<div id='newsPostInfo' style='float: left; margin-left: 15px'>posted by " . $member->getMemberLink() . " - " . getPreciseTime($newsInfo['dateposted']) . $dispNewsType . "<br>\n\t\t\t\t\t<span class='subjectText'>" . $newsInfo['postsubject'] . "</span></div>\n\t\t\t\t</div>\n\t\t\t\t<br>\n\t\t\t\t<div class='dottedLine' style='margin-top: 5px'></div>\n\t\t\t\t<div class='postMessage'>\n\t\t\t\t\t" . $dispNews . "\n\t\t\t\t</div>\n\t\t\t\t<div class='dottedLine' style='margin-top: 5px; margin-bottom: 5px'></div>\n\t\t\t\t<div class='main' style='margin-top: 0px; margin-bottom: 10px; padding-left: 5px'>" . $dispLastEdit . "</div>\n\t\t\t\t<p style='padding: 0px; margin: 0px' align='right'><b><a href='" . $MAIN_ROOT . "news/viewpost.php?nID=" . $newsInfo['news_id'] . "#comments'>Comments (" . $newsObj->countComments() . ")</a></b></p>\n\t\t\t</div>\n\t\t\n\t\t\n\t\t";
    }
}
if ($dispAnnouncements != "") {
    echo "<p class='main' style='font-size: 18px; font-weight: bold; padding-left: 15px'>Announcements</p>";
    echo $dispAnnouncements;
    if ($dispHPNews != "") {
        echo "<br>";
    }
}
if ($dispHPNews != "") {
    echo "<p class='main' style='font-size: 18px; font-weight: bold; padding-left: 15px'>Latest News</p>";
    echo $dispHPNews;
}
echo "\n<div>\n\n<table class='formTable' style='width: 65%; margin-left: auto; margin-right: auto; border-spacing: 0px' align='center'>\n\t<tr>\n\t\t<td class='formTitle' align='center'>Members Online Statistics</td>\n\t</tr>\n\t<tr>\n\t\t<td class='main solidBox' style='border-top-width: 0px' align='center'>\n\t\t\t<b>Members Online:</b> " . $membersOnlineCount . "<br>\n\t\t\t<p>\n\t\t\t\t";
if (constant('LOGGED_IN')) {