Example #1
0
 public function displayDownloadPageLink()
 {
     $downloadCatObj = new DownloadCategory($this->MySQL);
     $menuDownloadLinkInfo = $this->menuItemObj->objCustomPage->get_info();
     $downloadCatObj->select($menuDownloadLinkInfo['custompage_id']);
     echo "\n\t\t\t<div style='text-align: " . $menuDownloadLinkInfo['textalign'] . "'>\n\t\t\t" . $menuDownloadLinkInfo['prefix'] . "<a href='" . MAIN_ROOT . "downloads/index.php?catID=" . $menuDownloadLinkInfo['custompage_id'] . "' target='" . $menuDownloadLinkInfo['linktarget'] . "'>" . $downloadCatObj->get_info_filtered("name") . "</a>\n\t\t\t</div>\n\t\t\t";
 }
 public function displayDownloadPageLink()
 {
     $downloadCatObj = new DownloadCategory($this->MySQL);
     $menuDownloadLinkInfo = $this->menuItemObj->objCustomPage->get_info();
     $downloadCatObj->select($menuDownloadLinkInfo['custompage_id']);
     $menuItemInfo = $downloadCatObj->get_info_filtered();
     $menuDownloadLinkInfo['link'] = MAIN_ROOT . "downloads/?catID=" . $menuItemInfo['downloadcategory_id'];
     $this->formatLink($menuItemInfo, $menuDownloadLinkInfo);
 }
Example #3
0
}
$LOGGED_IN = false;
if (isset($_SESSION['btUsername']) and isset($_SESSION['btPassword'])) {
    $memberObj = new Member($mysqli);
    if ($memberObj->select($_SESSION['btUsername'])) {
        if ($memberObj->authorizeLogin($_SESSION['btPassword'])) {
            $LOGGED_IN = true;
        }
    }
}
$downloadCatObj = new DownloadCategory($mysqli);
$downloadObj = new Download($mysqli);
$blnShowDownload = false;
if ($downloadObj->select($_GET['dID'])) {
    $downloadInfo = $downloadObj->get_info_filtered();
    $downloadCatObj->select($downloadInfo['downloadcategory_id']);
    $accessType = $downloadCatObj->get_info("accesstype");
    if ($accessType == 1 && $LOGGED_IN) {
        $blnShowDownload = true;
    } elseif ($accessType == 0) {
        $blnShowDownload = true;
    }
    $fileContents1 = file_get_contents($downloadInfo['splitfile1']);
    $fileContents2 = file_get_contents($downloadInfo['splitfile2']);
    if ($blnShowDownload && $fileContents1 !== false && $fileContents2 !== false) {
        header("Content-Description: File Transfer");
        header("Content-Length: " . $downloadInfo['filesize'] . ";");
        header("Content-disposition: attachment; filename=" . $downloadInfo['filename']);
        header("Content-type: " . $downloadInfo['mimetype']);
        echo $fileContents1 . $fileContents2;
    }
Example #4
0
    }
    $downloadObj = new Download($mysqli);
    $downloadCatObj = new DownloadCategory($mysqli);
}
echo "\n\t<table class='formTable' style='margin-top: 0px; border-spacing: 0px'>\n\t\t<tr><td class='dottedLine' colspan='4'></td></tr>\n";
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "downloadcategory WHERE specialkey = '' ORDER BY ordernum DESC");
while ($row = $result->fetch_assoc()) {
    $arrDownloadCat[$row['downloadcategory_id']] = filterText($row['name']);
}
$dispOrderBY = isset($_POST['orderby']) && $_POST['orderby'] == "name" ? "ORDER BY name" : "ORDER BY dateuploaded ";
$dispOrderBY .= isset($_POST['dir']) && $_POST['dir'] == "asc" ? "ASC" : "DESC";
$editCatCID = $consoleObj->findConsoleIDByName("Manage Download Categories");
$addDLCID = $consoleObj->findConsoleIDByName("Add Download");
$totalDownloads = 0;
foreach ($arrDownloadCat as $catID => $catName) {
    $downloadCatObj->select($catID);
    $arrDownloads = $downloadCatObj->getAssociateIDs($dispOrderBY);
    if (count($arrDownloads) > 0) {
        echo "\n\t\t\t<tr>\n\t\t\t\t<td class='main manageList dottedLine' colspan='2' style='width: 76%'><b><u>" . $catName . "</u></b></td>\n\t\t\t\t<td class='main manageList dottedLine' align='center' style='width: 12%'><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $addDLCID . "&catID=" . $catID . "'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/add.png' class='manageListActionButton' title='Add Download to " . $catName . "'></a></td>\n\t\t\t\t<td class='main manageList dottedLine' align='center' style='width: 12%'><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $editCatCID . "&action=edit&catID=" . $catID . "'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/edit.png' class='manageListActionButton' title='Edit " . $catName . " Category'></a></td>\n\t\t\t</tr>\n\t\t";
        $altBGCount = 0;
        foreach ($arrDownloads as $dlID) {
            $downloadObj->select($dlID);
            $dlInfo = $downloadObj->get_info_filtered();
            if ($altBGCount == 0) {
                $addCSS = "";
                $altBGCount = 1;
            } else {
                $addCSS = " alternateBGColor";
                $altBGCount = 0;
            }
            $dispTime = getPreciseTime($dlInfo['dateuploaded']);
Example #5
0
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/downloadcategory.php";
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$downloadCatObj = new DownloadCategory($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Download Categories");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $downloadCatObj->select($_POST['catID'])) {
        define('MEMBERRANK_ID', $memberInfo['rank_id']);
        $downloadCatInfo = $downloadCatObj->get_info_filtered();
        $arrCats = $downloadCatObj->getAssociateIDs();
        if (count($arrCats) > 0) {
            echo "<div id='newDeleteMessage' style='display: none'><p align='center'>There are currently downloads with the download category <b>" . $downloadCatInfo['name'] . "</b>.  Please move all downloads out of this category before deleting it.</p></div>";
            echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\$('#deleteMessage').dialog('close');\n\t\t\t\t\t\t\$('#newDeleteMessage').dialog({\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle: 'Manage Download Categories - Delete',\n\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t'OK': function() {\n\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t";
        } elseif ($_POST['confirm'] == "1") {
            $downloadCatObj->delete();
            include "main.php";
        } else {
            echo "<p align='center'>Are you sure you want to delete the download category <b>" . $downloadCatInfo['name'] . "</b>?</p>";
        }
    } elseif (!$downloadCatObj->select($_POST['catID'])) {
        echo "<p align='center'>Unable find the selected download category.  Please try again or contact the website administrator.</p>";
    }
$downloadExtObj = new Basic($mysqli, "download_extensions", "extension_id");
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 Extensions
    $arrExtensions = explode(",", trim($_POST['catexts']));
    if (count($arrExtensions) <= 0) {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must enter at least one download extension.<br>";
    }
    // Check Cat Order
    $intNewOrderSpot = "";
    if (!$downloadCatObj->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 . "downloadcategory");
        $num_rows = $result->num_rows;
        if ($num_rows > 0) {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid category order. (category)<br>";
        } else {
            $intNewOrderSpot = 1;
        }
    } else {
        if ($_POST['beforeafter'] != "before" and $_POST['beforeafter'] != "after") {
            $countErrors++;
Example #7
0
 *
 */
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/downloadcategory.php";
$cID = $_GET['cID'];
$downloadCatObj = new DownloadCategory($mysqli);
$downloadExtensionObj = new Basic($mysqli, "download_extensions", "extension_id");
if (!$downloadCatObj->select($_GET['catID'])) {
    die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "members';</script>");
}
$downloadCatInfo = $downloadCatObj->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 Download Categories</a> > " . $downloadCatInfo['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 Extensions
    $arrExtensions = explode(",", trim($_POST['catexts']));
    if (count($arrExtensions) <= 0) {
        $countErrors++;
Example #8
0
    }
}
include_once $prevFolder . "classes/downloadcategory.php";
include_once $prevFolder . "classes/download.php";
$downloadObj = new Download($mysqli);
$downloadCatObj = new DownloadCategory($mysqli);
$downloadExtObj = new Basic($mysqli, "download_extensions", "extension_id");
$cID = $_GET['cID'];
$dispError = "";
$countErrors = 0;
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "downloadcategory WHERE specialkey = '' ORDER BY ordernum DESC");
while ($row = $result->fetch_assoc()) {
    $arrDownloadCat[] = $row['downloadcategory_id'];
    $dispSelected = isset($_GET['catID']) && $_GET['catID'] == $row['downloadcategory_id'] ? " selected" : "";
    $downloadcatoptions .= "<option value='" . $row['downloadcategory_id'] . "'" . $dispSelected . ">" . $row['name'] . "</option>";
    $downloadCatObj->select($row['downloadcategory_id']);
    $arrExtensions = array();
    foreach ($downloadCatObj->getExtensions() as $downloadExtID) {
        $downloadExtObj->select($downloadExtID);
        $arrExtensions[] = $downloadExtObj->get_info_filtered("extension");
    }
    $dispExtensions = implode(", ", $arrExtensions);
    $downloadCatJS .= "arrCatExtension[" . $row['downloadcategory_id'] . "] = '" . $dispExtensions . "';\n\t";
}
if (count($arrDownloadCat) == 0) {
    echo "\n\t\t<div style='display: none' id='errorBox'>\n\t\t\t<p align='center'>\n\t\t\t\tA download category must be added before adding downloads!\n\t\t\t</p>\n\t\t</div>\n\t\t\n\t\t<script type='text/javascript'>\n\t\t\tpopupDialog('Add Download', '" . $MAIN_ROOT . "members', 'errorBox');\n\t\t</script>\n\t";
    exit;
}
if ($_POST['submit']) {
    // Check Name
    if (trim($_POST['title']) == "") {
Example #9
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
 *
 */
// Config File
$prevFolder = "../";
include_once $prevFolder . "_setup.php";
$downloadCatObj = new DownloadCategory($mysqli);
$downloadObj = new Download($mysqli);
if (!$downloadCatObj->select($_GET['catID'])) {
    die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "';</script>");
}
$ipbanObj = new Basic($mysqli, "ipban", "ipaddress");
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();
    }
}
$downloadCatInfo = $downloadCatObj->get_info_filtered();
// Start Page
$PAGE_NAME = $downloadCatInfo['name'] . " - Downloads - ";
$dispBreadCrumb = "";