Example #1
0
 public function addConsoleCategory()
 {
     $consoleCatID = "";
     if ($this->pluginConsoleCategory != "") {
         $result = $this->MySQL->query("SELECT consolecategory_id FROM " . $this->MySQL->get_tablePrefix() . "consolecategory WHERE name = '" . $this->pluginConsoleCategory . "'");
         if ($result->num_rows == 0) {
             $consoleCatObj = new ConsoleCategory($this->MySQL);
             $newOrderNum = $consoleCatObj->getHighestOrderNum() + 1;
             $consoleCatObj->addNew(array("name", "ordernum"), array($this->pluginConsoleCategory, $newOrderNum));
             $consoleCatID = $consoleCatObj->get_info("consolecategory_id");
         } else {
             $row = $result->fetch_assoc();
             $consoleCatID = $row['consolecategory_id'];
         }
     }
     return $consoleCatID;
 }
Example #2
0
         $dispError[] = "There is database table that conflicts with this plugin.";
     }
 }
 if ($countErrors == 0) {
     $sql = "\n\t\t\n\t\tCREATE TABLE IF NOT EXISTS `" . $dbprefix . "twitter` (\n\t\t  `twitter_id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `member_id` int(11) NOT NULL,\n\t\t  `oauth_token` varchar(255) NOT NULL,\n\t\t  `oauth_tokensecret` varchar(255) NOT NULL,\n\t\t  `username` varchar(20) NOT NULL,\n\t\t  `name` varchar(255) NOT NULL,\n\t\t  `description` text NOT NULL,\n\t\t  `followers` int(11) NOT NULL,\n\t\t  `following` int(11) NOT NULL,\n\t\t  `tweets` int(11) NOT NULL,\n\t\t  `profilepic` text NOT NULL,\n\t\t  `lasttweet_id` varchar(255) NOT NULL,\n\t\t  `lasttweet_html` text NOT NULL,\n\t\t  `showfeed` int(11) NOT NULL,\n\t\t  `embedtweet` int(11) NOT NULL,\n\t\t  `infocard` int(11) NOT NULL,\n\t\t  `allowlogin` int(11) NOT NULL,\n\t\t  `lastupdate` int(11) NOT NULL,\n\t\t  `loginhash` varchar(32) NOT NULL,\n\t\t  PRIMARY KEY (`twitter_id`)\n\t\t) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\n\t\n\t\t";
     if ($mysqli->query($sql)) {
         $jsonAPIKey = json_encode($arrAPIKeys);
         $pluginObj->addNew(array("name", "filepath", "dateinstalled", "apikey"), array($PLUGIN_NAME, $_POST['pluginDir'], time(), $jsonAPIKey));
         $pluginID = $pluginObj->get_info("plugin_id");
         $pluginObj->pluginPage->setCategoryKeyValue($pluginID);
         $pluginPageSortNum = $pluginObj->pluginPage->getHighestSortNum() + 1;
         $pluginObj->pluginPage->addNew(array("plugin_id", "page", "pagepath", "sortnum"), array($pluginID, "profile", "plugins/twitter/_profile.php", $pluginPageSortNum));
         // Check if need to add new console category
         $result = $mysqli->query("SELECT consolecategory_id FROM " . $dbprefix . "consolecategory WHERE name = 'Social Media Connect'");
         if ($result->num_rows == 0) {
             $consoleCatObj = new ConsoleCategory($mysqli);
             $newOrderNum = $consoleCatObj->getHighestOrderNum() + 1;
             $consoleCatObj->addNew(array("name", "ordernum"), array("Social Media Connect", $newOrderNum));
             $consoleCatID = $consoleCatObj->get_info("consolecategory_id");
         } else {
             $row = $result->fetch_assoc();
             $consoleCatID = $row['consolecategory_id'];
         }
         $consoleObj->setCategoryKeyValue($consoleCatID);
         $newSortNum = $consoleObj->getHighestSortNum() + 1;
         $consoleObj->addNew(array("consolecategory_id", "pagetitle", "filename", "sortnum"), array($consoleCatID, $PLUGIN_NAME, "../plugins/twitter/twitterconnect.php", $newSortNum));
     } else {
         $countErrors++;
         $dispError[] = "Unable to create plugin database table.";
     }
 }
Example #3
0
/*
 * 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
 *
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/consolecategory.php";
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$cID = $consoleObj->findConsoleIDByName("Manage Console Options");
$consoleObj->select($cID);
$consoleCatObj = new ConsoleCategory($mysqli);
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $consoleCatObj->select($_POST['catID'])) {
        define('MEMBERRANK_ID', $memberInfo['rank_id']);
        $consoleCatObj->move($_POST['cDir']);
        $_GET['cID'] = $cID;
        include "main.php";
    }
}
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    exit;
} else {
    $memberInfo = $member->get_info_filtered();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
include_once $prevFolder . "classes/consolecategory.php";
$cID = $_GET['cID'];
$consoleCatObj = new ConsoleCategory($mysqli);
if ($_POST['submit']) {
    // Check Category Name
    if (trim($_POST['catname']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must enter a Category Name.<br>";
    }
    // Check Cat Order
    $intNewOrderSpot = "";
    if (!$consoleCatObj->select($_POST['catorder']) and $_POST['catorder'] != "first") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid category order. (category)<br>";
    } elseif ($_POST['catorder'] == "first") {
        // "(no other categories)" selected, check to see if there are actually no other categories
        $result = $mysqli->query("SELECT * FROM " . $dbprefix . "consolecategory WHERE adminoption = '0'");
        $num_rows = $result->num_rows;
Example #5
0
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    exit;
} else {
    $memberInfo = $member->get_info_filtered();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
include_once $prevFolder . "classes/consolecategory.php";
$cID = $_GET['cID'];
$consoleCatObj = new ConsoleCategory($mysqli);
if (!$consoleCatObj->select($_GET['catID'])) {
    die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "members';</script>");
}
$consoleCatInfo = $consoleCatObj->get_info_filtered();
echo "\n\n<script type='text/javascript'>\n\$(document).ready(function() {\n\$('#breadCrumb').html(\"<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>Manage Console Categories</a> > " . $consoleCatInfo['name'] . "\");\n});\n</script>\n";
if ($_POST['submit']) {
    $resortOrder = false;
    // Check Category Name
    if (trim($_POST['catname']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must enter a Category Name.<br>";
    }
    // Check Cat Order
    $intNewOrderSpot = "";
    if (!$consoleCatObj->select($_POST['catorder']) and $_POST['catorder'] != "first") {
Example #6
0
 *
 * Author: Bluethrust Web Development
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/consolecategory.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$consoleCatObj = new ConsoleCategory($mysqli);
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Console Options");
$consoleObj->select($cID);
$counter = 0;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $consoleCatObj->select($_POST['catID'])) {
        $addSQL = "";
        $selectedConsole = "";
        if ($_POST['cnID'] != "" && $consoleObj->SELECT($_POST['cnID'])) {
            $addSQL = " AND console_id != '" . $_POST['cnID'] . "'";
            $consoleInfo = $consoleObj->get_info_filtered();
            if ($consoleInfo['consolecategory_id'] == $_POST['catID']) {
                $arrBeforeAfter = $consoleObj->findBeforeAfter();
                $selectedConsole = $arrBeforeAfter[0];
Example #7
0
 // $sql variable
 include BASE_DIRECTORY . "plugins/donations/sql.php";
 if ($mysqli->multi_query($sql)) {
     do {
         if ($result = $mysqli->store_result()) {
             $result->free();
         }
     } while ($mysqli->next_result());
     $pluginObj->addNew(array("name", "filepath", "dateinstalled"), array($PLUGIN_NAME, $_POST['pluginDir'], time()));
     $pluginID = $pluginObj->get_info("plugin_id");
     $pluginObj->pluginPage->setCategoryKeyValue($pluginID);
     $pluginObj->pluginPage->addNew(array("plugin_id", "page", "pagepath"), array($pluginID, "mods", "plugins/donations/include/menu_module.php"));
     // Check if need to add new console category
     $result = $mysqli->query("SELECT consolecategory_id FROM " . $dbprefix . "consolecategory WHERE name = 'Donations'");
     if ($result->num_rows == 0) {
         $consoleCatObj = new ConsoleCategory($mysqli);
         $newOrderNum = $consoleCatObj->getHighestOrderNum() + 1;
         $consoleCatObj->addNew(array("name", "ordernum"), array("Donations", $newOrderNum));
         $consoleCatID = $consoleCatObj->get_info("consolecategory_id");
     } else {
         $row = $result->fetch_assoc();
         $consoleCatID = $row['consolecategory_id'];
     }
     $consoleObj->setCategoryKeyValue($consoleCatID);
     $newSortNum = $consoleObj->getHighestSortNum() + 1;
     $consoleObj->addNew(array("consolecategory_id", "pagetitle", "filename", "sortnum"), array($consoleCatID, "Create a Donation Campaign", "../plugins/donations/console/createcampaign.php", $newSortNum++));
     $consoleObj->addNew(array("consolecategory_id", "pagetitle", "filename", "sortnum"), array($consoleCatID, "Manage Donation Campaigns", "../plugins/donations/console/managecampaign.php", $newSortNum++));
 } else {
     $countErrors++;
     $dispError[] = "Unable to create plugin database table.";
 }
Example #8
0
 * Author: Bluethrust Web Development
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/consolecategory.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$consoleObj = new ConsoleOption($mysqli);
$consoleCatObj = new ConsoleCategory($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Console Options");
$consoleObj->select($cID);
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $consoleObj->select($_POST['cID'])) {
        define('MEMBERRANK_ID', $memberInfo['rank_id']);
        $consoleInfo = $consoleObj->get_info();
        $consoleCatObj->select($consoleInfo['consolecategory_id']);
        $arrAssociates = $consoleCatObj->getAssociateIDs("ORDER BY sortnum");
        array_unshift($arrAssociates, "");
        unset($arrAssociates[0]);
        $intSortNum = $consoleInfo['sortnum'];
        $moveUp = $intSortNum - 1;
        $moveDown = $intSortNum + 1;
        $makeMove = "";
 */
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    exit;
} else {
    $memberInfo = $member->get_info_filtered();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
include_once $prevFolder . "classes/btupload.php";
include_once $prevFolder . "classes/consolecategory.php";
include_once $prevFolder . "classes/rankcategory.php";
$cID = $_GET['cID'];
$rankCatObj = new RankCategory($mysqli);
$consoleCatObj = new ConsoleCategory($mysqli);
$failbanObj = new Basic($mysqli, "failban", "failban_id");
$intMaxAttempts = 3;
if ($_POST['submit']) {
    $countErrors = 0;
    // Check Page Title
    if (trim($_POST['pagetitle']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must give the console option a page title.<br>";
    }
    // Check Console Category
    if (!$consoleCatObj->select($_POST['consolecat'])) {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid console category.<br>";
    } else {
        $arrConsoleIDs = $consoleCatObj->getAssociateIDs();
Example #10
0
     $randomString = substr(md5(uniqid("", true)), 0, 22);
     $randomNum = rand(4, 10);
     if ($randomNum < 10) {
         $randomNum = "0" . $randomNum;
     }
     $strSalt = "\$2a\$" . $randomNum . "\$" . $randomString;
     $encryptPassword = crypt($_POST['adminpassword'], $strSalt);
     $mysqli->query("INSERT INTO " . $_POST['tableprefix'] . "members (username, password, password2, rank_id, datejoined, lastlogin) VALUES ('" . $_POST['adminusername'] . "', '" . $encryptPassword . "', '" . $strSalt . "', '1', '" . time() . "', '" . time() . "')");
 } else {
     if ($blnConvertWebsiteInfo) {
         // Convert websiteinfo table for people updating
         define("CONVERT_WEBSITEINFO", true);
         include "steps/convertwebsiteinfo.php";
     }
     // Updating --> Check for all console options and categories
     $consoleCatObj = new ConsoleCategory($mysqli);
     $consoleOptionObj = new ConsoleOption($mysqli);
     // Checking Console Categories First
     $arrConsoleCategoryIDs = array();
     $arrCheckConsoleCategories = array();
     $result = $mysqli->query("SELECT * FROM " . $_POST['tableprefix'] . "consolecategory ORDER BY ordernum DESC");
     while ($row = $result->fetch_assoc()) {
         $arrCheckConsoleCategories[] = $row['name'];
         if (in_array($row['name'], $arrConsoleCategories)) {
             $tempCatID = array_search($row['name'], $arrConsoleCategories);
             $arrConsoleCategoryIDs[$tempCatID] = $row['consolecategory_id'];
         }
     }
     $pmCatID = "";
     foreach ($arrConsoleCategories as $consoleCategory) {
         if (!in_array($consoleCategory, $arrCheckConsoleCategories)) {
Example #11
0
 $result = $mysqli->query("SELECT * FROM " . $mysqli->get_tablePrefix() . "consolecategory ORDER BY ordernum DESC");
 while ($row = $result->fetch_assoc()) {
     $arrConsoleCats[] = $row['consolecategory_id'];
 }
 $result->free();
 $arrFullySortedConsole = array();
 $consoleObj = new ConsoleOption($mysqli);
 foreach ($rankPrivileges as $consoleoption) {
     $consoleObj->select($consoleoption);
     $consoleInfo = $consoleObj->get_info();
     if ($member->hasAccess($consoleObj) && $consoleInfo['hide'] == 0) {
         $sortNum = array_search($consoleInfo['consolecategory_id'], $arrConsoleCats);
         $arrFullySortedConsole[$sortNum][] = $consoleoption;
     }
 }
 $consoleCatObj = new ConsoleCategory($mysqli);
 $dispConsoleOptions = "";
 $dispConsoleCategories = "";
 $counter = 0;
 $totalConsoleCats = count($arrConsoleCats);
 foreach ($arrConsoleCats as $key => $categoryID) {
     $consoleCatObj->select($categoryID);
     $consoleCatInfo = $consoleCatObj->get_info_filtered();
     $arrConsoleOptions = $arrFullySortedConsole[$key];
     $categoryCSS = "consoleCategory_clicked";
     if (count($arrConsoleOptions)) {
         $blnShowCategoryList = false;
         $hideoptions = "";
         if ($counter > 0) {
             $hideoptions = "style='display: none'";
             $categoryCSS = "consoleCategory";
Example #12
0
 * Author: Bluethrust Web Development
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/consolecategory.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$consoleObj = new ConsoleOption($mysqli);
$consoleCatObj = new ConsoleCategory($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Console Options");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $consoleCatObj->select($_POST['cID'])) {
        define('MEMBERRANK_ID', $memberInfo['rank_id']);
        $consoleCatInfo = $consoleCatObj->get_info();
        $arrAssociates = $consoleCatObj->getAssociateIDs("ORDER BY sortnum");
        $resortOrder = false;
        if (count($arrAssociates) > 0) {
            $consoleObj->select($arrAssociates[0]);
            $intSpot = $consoleObj->makeRoom("before");
            $resortOrder = true;
        } else {
Example #13
0
    exit;
} else {
    $memberInfo = $member->get_info_filtered();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
echo "\n<script type='text/javascript'>\n\n\$(document).ready(function() {\n\$('#breadCrumb').html(\"<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > Manage Console Categories\");\n});\n\n</script>\n";
include_once $prevFolder . "classes/consolecategory.php";
$cID = $_GET['cID'];
if ($cID == "") {
    $cID = $consoleObj->findConsoleIDByName("Manage Console Categories");
}
$intAddNewConsoleCatID = $consoleObj->findConsoleIDByName("Add New Console Category");
$consoleCatObj = new ConsoleCategory($mysqli);
$intHighestOrder = $consoleCatObj->getHighestOrderNum();
$counter = 0;
$x = 1;
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "consolecategory ORDER BY ordernum DESC");
while ($row = $result->fetch_assoc()) {
    if ($counter == 1) {
        $addCSS = " alternateBGColor";
        $counter = 0;
    } else {
        $addCSS = "";
        $counter = 1;
    }
    if ($x == 1) {
        $dispUpArrow = "<img src='" . $MAIN_ROOT . "images/transparent.png' width='24' height'24'>";
    } else {