Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
clanscripts
===========

A CMS built for Clans, Guilds and Gaming Communities - Bluethrust Clan Scripts: Open Source Clan CMS

Welcome! Bluethrust Clan Scripts is an open source clan website manager that helps you easily create and run your clan, guild or gaming community website.

Clan Scripts v4 is still in development so if you have an idea for a feature you would like to see, e-mail: cs4ideas@bluethrust.com or post a topic in the forum.

For more information, visit the [website](http://www.Bluethrust.com "Bluethrust's Homepage").

Requirements
===========
Webserver (Apacha, nginx etc)
PHP 5.3 or higher
Mysql database

Install
===========
1. upload all files to your server via preferred method/programof

2. Create a new database user, with own database and ALL PRIVILEGES

3. Point your browser to domain.com/install/install.php and fill out the correct information with your database information and username and password, website admin(superuser)..

4. Delete the install directory for safety measures,

5. You have successfully installed BT clan scripts v4!!

Upgrade
===========

Demo
===========
# [View Demo](http://www.bluethrust.com/cs4demo "bluethrust's Demopage")

Copyrights
===========

License
===========
[license](http://www.bluethrust.com/license.php "bluethrust's Licensepage")

Note
===========
This README isn't finish yet
5 changes: 0 additions & 5 deletions _setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

// This setup page should not be changed. Edit _config.php to configure your website.

ini_set('display_errors', 0);

if(get_magic_quotes_gpc() == 1) {
foreach($_GET as $key=>$value) { $_GET[$key] = stripslashes($value); }
Expand Down Expand Up @@ -75,11 +74,7 @@

if($websiteInfo['debugmode'] == 1) {
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
}
else {
ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_WARNING);
ini_set('display_errors', 1);
}


Expand Down
File renamed without changes.
263 changes: 114 additions & 149 deletions forum/index.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<?php

/*
* Bluethrust Clan Scripts v4
* Copyright 2014
*
* Author: Bluethrust Web Development
* E-mail: support@bluethrust.com
* Website: http://www.bluethrust.com
*
* License: http://www.bluethrust.com/license.php
*
/** Bluethrust Clan Scripts v4
* @author Bluethrust Development Team
* @version 4
* @mail support@bluethrust.com
* @website http://www.bluethrust.com
* @copyright 2012 - 2014 - Bluethrust Web Development
* @copyright 2014 - 2014 - Bluethrust Development Team
* @license http://www.bluethrust.com/license.php
*
*/

// Config File
$prevFolder = "../";

include($prevFolder."_setup.php");
include ("{$prevFolder}_setup.php");

include_once($prevFolder."classes/member.php");
include_once($prevFolder."classes/forumboard.php");
include_once ("{$prevFolder}classes/member.php");
include_once ("{$prevFolder}classes/forumboard.php");

$consoleObj = new ConsoleOption($mysqli);
$boardObj = new ForumBoard($mysqli);
Expand All @@ -33,176 +32,142 @@

$ipbanObj = new Basic($mysqli, "ipban", "ipaddress");

if($ipbanObj->select($IP_ADDRESS, false)) {
$ipbanInfo = $ipbanObj->get_info();
if ($ipbanObj->select($IP_ADDRESS, false)) {
$ipbanInfo = $ipbanObj->get_info();

if(time() < $ipbanInfo['exptime'] OR $ipbanInfo['exptime'] == 0) {
die("<script type='text/javascript'>window.location = '".$MAIN_ROOT."banned.php';</script>");
}
else {
$ipbanObj->delete();
}
if (time() < $ipbanInfo['exptime'] or $ipbanInfo['exptime'] == 0) {
die("<script type='text/javascript'>window.location = '{$MAIN_ROOT}banned.php';</script>");
} else {
$ipbanObj->delete();
}

}


// Start Page
$PAGE_NAME = "Forum - ";
$dispBreadCrumb = "";
include($prevFolder."themes/".$THEME."/_header.php");
include ("{$prevFolder}themes/{$THEME}/_header.php");

// Check Private Forum

if($websiteInfo['privateforum'] == 1 && !constant("LOGGED_IN")) {
die("<script type='text/javascript'>window.location = '".$MAIN_ROOT."login.php';</script>");
if ($websiteInfo['privateforum'] == 1 && !constant("LOGGED_IN")) {
die("<script type='text/javascript'>window.location = '{$MAIN_ROOT}login.php';</script>");
}

$memberInfo = array();

$LOGGED_IN = false;
if ($member->select($_SESSION['btUsername']) && $member->authorizeLogin($_SESSION['btPassword'])) {
$memberInfo = $member->get_info_filtered();
$LOGGED_IN = true;
}

echo "<div class='breadCrumbTitle'>Forum</div>
<div class='breadCrumb' style='padding-top: 0px; margin-top: 0px'>
<a href='{$MAIN_ROOT}'>Home</a> > Forum
</div>
<table class='forumTable'>";


$LOGGED_IN = false;
if($member->select($_SESSION['btUsername']) && $member->authorizeLogin($_SESSION['btPassword'])) {
$memberInfo = $member->get_info_filtered();
$LOGGED_IN = true;
$result = $mysqli->query("SELECT forumcategory_id FROM {$dbprefix}forum_category ORDER BY ordernum DESC");
while ($row = $result->fetch_assoc()) {
$arrForumCats[] = $row['forumcategory_id'];

}
$categoryObj->select($row['forumcategory_id']);
$catInfo = $categoryObj->get_info_filtered();
$arrBoards = $categoryObj->getAssociateIDs("AND subforum_id = '0' ORDER BY sortnum", true);
$dispBoards = "";
foreach ($arrBoards as $boardID) {

$boardObj->select($boardID);

echo "
<div class='breadCrumbTitle'>Forum</div>
<div class='breadCrumb' style='padding-top: 0px; margin-top: 0px'>
<a href='".$MAIN_ROOT."'>Home</a> > Forum
</div>

<table class='forumTable'>
";


$result = $mysqli->query("SELECT forumcategory_id FROM ".$dbprefix."forum_category ORDER BY ordernum DESC");
while($row = $result->fetch_assoc()) {
$arrForumCats[] = $row['forumcategory_id'];

$categoryObj->select($row['forumcategory_id']);
$catInfo = $categoryObj->get_info_filtered();
$arrBoards = $categoryObj->getAssociateIDs("AND subforum_id = '0' ORDER BY sortnum", true);
$dispBoards = "";
foreach($arrBoards as $boardID) {

$boardObj->select($boardID);

if($boardObj->memberHasAccess($memberInfo)) {
$boardInfo = $boardObj->get_info_filtered();
$arrForumTopics = $boardObj->getForumTopics();

$newTopicBG = "";
$dispNewTopicIMG = "";

if($LOGGED_IN && $boardObj->hasNewTopics($memberInfo['member_id'])) {
$dispNewTopicIMG = " <img style='margin-left: 5px' src='".$MAIN_ROOT."themes/".$THEME."/images/forum-new.png' title='New Posts!'>";
$newTopicBG = " boardNewPostBG";
}

// Get Last Post Display Info
if(count($arrForumTopics) > 0) {
$boardObj->objPost->select($arrForumTopics[0]);
$firstPostInfo = $boardObj->objPost->get_info_filtered();

$boardObj->objTopic->select($firstPostInfo['forumtopic_id']);
$lastPostID = $boardObj->objTopic->get_info("lastpost_id");

$boardObj->objPost->select($lastPostID);
$lastPostInfo = $boardObj->objPost->get_info_filtered();

$postMemberObj->select($lastPostInfo['member_id']);

$dispLastPost = "<div class='boardLastPostTitle'><a href='viewtopic.php?tID=".$firstPostInfo['forumtopic_id']."#".$lastPostID."' title='".$firstPostInfo['title']."'>".$firstPostInfo['title']."</a></div>by ".$postMemberObj->getMemberLink()."<br>".getPreciseTime($lastPostInfo['dateposted']);
}
else {
$dispLastPost = "<div style='text-align: center'>No Posts</div>";
}

$dispTopicCount = $boardObj->countTopics();
$dispPostCount = $boardObj->countPosts();

$arrDispSubForums = array();
$arrSubForums = $boardObj->getSubForums();

foreach($arrSubForums as $value) {
$subForumObj->select($value);
$subForumInfo = $subForumObj->get_info_filtered();

$arrDispSubForums[] = "<a href='".$MAIN_ROOT."forum/viewboard.php?bID=".$value."'>".$subForumInfo['name']."</a>";
}


$dispSubForums = "";
if(count($arrDispSubForums) > 0) {
$dispSubForums = "<br><br><b>Sub-Forums:</b><br>&nbsp;&nbsp;".implode("&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;", $arrDispSubForums);
}


$dispBoards .= "
<tr class='boardRows'>
<td class='boardName dottedLine".$newTopicBG."'><a href='viewboard.php?bID=".$boardInfo['forumboard_id']."'>".$boardInfo['name']."</a>".$dispNewTopicIMG."<br><span class='boardDescription'>".$boardInfo['description'].$dispSubForums."</span></td>
<td class='dottedLine boardLastPost".$newTopicBG."'>".$dispLastPost."</td>
<td class='dottedLine boardTopicCount".$newTopicBG."' align='center'>".$dispTopicCount."</td>
<td class='dottedLine boardTopicCount".$newTopicBG."' align='center'>".$dispPostCount."</td>

</tr>
";

}

}


if($dispBoards != "") {

echo "
<tr>
if ($boardObj->memberHasAccess($memberInfo)) {
$boardInfo = $boardObj->get_info_filtered();
$arrForumTopics = $boardObj->getForumTopics();

$newTopicBG = "";
$dispNewTopicIMG = "";

if ($LOGGED_IN && $boardObj->hasNewTopics($memberInfo['member_id'])) {
$dispNewTopicIMG = " <img style='margin-left: 5px' src='{$MAIN_ROOT}themes/{$THEME}/images/forum-new.png' title='New Posts!'>";
$newTopicBG = " boardNewPostBG";
}

// Get Last Post Display Info
if (count($arrForumTopics) > 0) {
$boardObj->objPost->select($arrForumTopics[0]);
$firstPostInfo = $boardObj->objPost->get_info_filtered();

$boardObj->objTopic->select($firstPostInfo['forumtopic_id']);
$lastPostID = $boardObj->objTopic->get_info("lastpost_id");

$boardObj->objPost->select($lastPostID);
$lastPostInfo = $boardObj->objPost->get_info_filtered();

$postMemberObj->select($lastPostInfo['member_id']);

$dispLastPost = "<div class='boardLastPostTitle'><a href='viewtopic.php?tID={$firstPostInfo['forumtopic_id']}#{$lastPostID}' title='{$firstPostInfo['title']}'>{$firstPostInfo['title']}</a></div>by " .
$postMemberObj->getMemberLink() . "<br>" . getPreciseTime($lastPostInfo['dateposted']);
} else {
$dispLastPost = "<div style='text-align: center'>No Posts</div>";
}

$dispTopicCount = $boardObj->countTopics();
$dispPostCount = $boardObj->countPosts();

$arrDispSubForums = array();
$arrSubForums = $boardObj->getSubForums();

foreach ($arrSubForums as $value) {
$subForumObj->select($value);
$subForumInfo = $subForumObj->get_info_filtered();

$arrDispSubForums[] = "<a href='{$MAIN_ROOT}forum/viewboard.php?bID={$value}'>{$subForumInfo['name']}</a>";
}


$dispSubForums = "";
if (count($arrDispSubForums) > 0) {
$dispSubForums = "<br><br><b>Sub-Forums:</b><br>&nbsp;&nbsp;" . implode("&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;",
$arrDispSubForums);
}


$dispBoards .= "<tr class='boardRows'>
<td class='boardName dottedLine{$newTopicBG}'><a href='viewboard.php?bID={$boardInfo['forumboard_id']}'>{$boardInfo['name']}</a>{$dispNewTopicIMG}<br><span class='boardDescription'>{$boardInfo['description']}{$dispSubForums}</span></td>
<td class='dottedLine boardLastPost{$newTopicBG}'>{$dispLastPost}</td>
<td class='dottedLine boardTopicCount{$newTopicBG}' align='center'>{$dispTopicCount}</td>
<td class='dottedLine boardTopicCount{$newTopicBG}' align='center'>{$dispPostCount}</td>
</tr>";
}
}

if ($dispBoards != "") {

echo "<tr>
<td colspan='4' class='boardCategory'>
".$catInfo['name']."
{$catInfo['name']}
</td>
</tr>
<tr>
<td class='boardTitles-Name'>Forum:</td>
<td class='boardTitles-LastPost' style='border-left: 0px'>Last Post:</td>
<td class='boardTitles-TopicCount' style='border-left: 0px'>Topics:</td>
<td class='boardTitles-TopicCount' style='border-left: 0px'>Posts:</td>
</tr>
";
echo $dispBoards;

echo "<tr><td colspan='4'><br></td></tr>";

}


</tr>";
echo $dispBoards;
echo "<tr><td colspan='4'><br></td></tr>";
}
}

if($result->num_rows == 0) {
if ($result->num_rows == 0) {

echo "

<div class='shadedBox' style='width: 40%; margin: 20px auto'>
echo "<div class='shadedBox' style='width: 40%; margin: 20px auto'>
<p class='main' align='center'>
No boards have been made yet!
</p>
</div>

";

</div>";
}


echo "</table>";


?>


<?php
include($prevFolder."themes/".$THEME."/_footer.php");
include ("{$prevFolder}themes/{$THEME}/_footer.php");
?>
Loading