Exemple #1
0
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/download.php";
include_once "../../../../classes/downloadcategory.php";
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Downloads");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
// Check Login
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $memberInfo = $member->get_info();
} else {
    exit;
}
$downloadObj = new Download($mysqli);
$downloadCatObj = new DownloadCategory($mysqli);
if ($downloadObj->select($_POST['dlID']) && isset($_POST['confirm'])) {
    $downloadInfo = $downloadObj->get_info_filtered();
    $downloadObj->delete();
    unlink("../../../../" . $downloadInfo['splitfile1']);
    unlink("../../../../" . $downloadInfo['splitfile2']);
    include "downloadlist.php";
} elseif ($downloadObj->select($_POST['dlID'])) {
    $downloadInfo = $downloadObj->get_info_filtered();
    echo "\n\t\t<p align='center' class='main'>Are you sure you want to delete the download: <b>" . $downloadInfo['name'] . "</b>?</p>\t\n\t";
} else {
    echo "\n\t\t<p align='center' class='main'>Download not found</p>\n\t";
}
Exemple #2
0
        $ipbanObj->delete();
    }
}
$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']);
 public function download($imageId, $token)
 {
     if (!Auth::user()->check()) {
         return App::abort(404);
     }
     $image = Download::select('path', 'short_name')->join('image_details', function ($join) {
         $join->on('image_details.detail_id', '=', 'downloads.image_detail_id')->on('image_details.image_id', '=', 'downloads.image_id');
     })->join('images', 'images.id', '=', 'downloads.image_id')->where('downloads.image_id', $imageId)->where('token', $token)->where('user_id', Auth::user()->get()->id)->first();
     if (!is_object($image)) {
         return App::abort(404);
     }
     return Response::download(public_path($image->path), $image->short_name . '.jpg');
 }
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']);
            echo "\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='main manageList dottedLine" . $addCSS . "' style='width: 46%; padding-left: 10px; font-weight: bold'><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&action=edit&dlID=" . $dlID . "'>" . $dlInfo['name'] . "</a></td>\n\t\t\t\t\t<td class='main manageList dottedLine" . $addCSS . "' style='width: 30%; padding-left: 5px'>" . $dispTime . "</td>\n\t\t\t\t\t<td class='main manageList dottedLine" . $addCSS . "' align='center' style='width: 12%'><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&action=edit&dlID=" . $dlID . "'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/edit.png' class='manageListActionButton' title='Edit Download'></a></td>\n\t\t\t\t\t<td class='main manageList dottedLine" . $addCSS . "' align='center' style='width: 12%'><a href='javascript:void(0)' onclick=\"deleteDL('" . $dlID . "')\"><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/delete.png' class='manageListActionButton'></a></td>\n\t\t\t\t</tr>\n\t\t\t";
            $totalDownloads++;
        }
    }
}
echo "</table>";
 public function delete()
 {
     $returnVal = false;
     if ($this->intTableKeyValue != "") {
         $returnVal = parent::delete();
         $downloadObj = new Download($this->MySQL);
         $arrAttachments = $this->getPostAttachements();
         foreach ($arrAttachments as $attachment) {
             $downloadObj->select($attachment);
             $downloadObj->delete();
         }
     }
 }
 * Author: Bluethrust Web Development
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    exit;
} else {
    $memberInfo = $member->get_info();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
include_once $prevFolder . "classes/downloadcategory.php";
include_once $prevFolder . "classes/download.php";
$downloadObj = new Download($mysqli);
$downloadCatObj = new DownloadCategory($mysqli);
if (isset($_GET['dlID']) && $downloadObj->select($_GET['dlID'])) {
    $downloadInfo = $downloadObj->get_info_filtered();
    $downloadCatObj->select($downloadInfo['downloadcategory_id']);
    $downloadCatInfo = $downloadCatObj->get_info_filtered();
    include "include/edit.php";
} else {
    $addDLCID = $consoleObj->findConsoleIDByName("Add Download");
    echo "\n\t\t\t\n\t\t\t<table class='formTable'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='main' colspan='3' align='right'>&raquo; <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $addDLCID . "'>Add New Download</a> &laquo;</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formTitle' style='width: 46%'>Download:</td>\n\t\t\t\t\t<td class='formTitle' style='width: 30%'>Date Uploaded:</td>\n\t\t\t\t\t<td class='formTitle' style='width: 24%'>Actions:</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<div id='loadingSpiral' class='loadingSpiral'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral.gif'><br>Loading\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div id='downloadList'>\n\t\t\t\n\t\t\t\t";
    include "include/downloadlist.php";
    echo "\n\t\t\t\n\t\t\t</div>\n\t\t\t\n\t\t\t<div id='deleteMessage' style='display: none'></div>\n\t\t\t<script type='text/javascript'>\n\t\t\t\n\t\t\t\tfunction deleteDL(intDLID) {\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/downloads/include/delete.php', { dlID: intDLID }, function(data) {\n\t\t\t\t\t\t\t\$('#deleteMessage').html(data);\n\t\t\t\t\t\t\t\$('#deleteMessage').dialog({\n\t\t\t\t\t\t\t\ttitle: 'Delete Download - Confirm',\n\t\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t\t'Yes': function() {\n\t\t\t\t\t\t\t\t\t\t\$('#downloadList').fadeOut(200);\n\t\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/downloads/include/delete.php', { dlID: intDLID, confirm: 1 }, function(data1) {\n\t\t\t\t\t\t\t\t\t\t\t\$('#downloadList').html(data1);\n\t\t\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\t\t\t\t\t\$('#downloadList').fadeIn(200);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'Cancel': function() {\n\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\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}\n\t\t\t\n\t\t\t</script>\n\t";
}
Exemple #7
0
        if ($i > $medalCount) {
            break;
        }
    }
}
$setAvatarWidth = $websiteInfo['forum_avatarwidth'] > 0 ? $websiteInfo['forum_avatarwidth'] : "50";
$setAvatarWidthUnit = $websiteInfo['forum_avatarwidthunit'] == "%" ? "%" : "px";
$setAvatarHeight = $websiteInfo['forum_avatarheight'] > 0 ? $websiteInfo['forum_avatarheight'] : "50";
$setAvatarHeightUnit = $websiteInfo['forum_avatarheightunit'] == "%" ? "%" : "px";
$dispForumPostText = $websiteInfo['forum_linkimages'] == 1 ? autoLinkImage(parseBBCode($postMessage)) : parseBBCode($postMessage);
echo "<div class='forumPostContainer'>\n\t\t\t<div class='forumPostPosterInfo main'><a name='" . $postInfo['forumpost_id'] . "'></a>\n\t\t\t\t<span class='boardPosterName'>" . $posterMemberObj->getMemberLink() . "</span><br>\n\t\t\t\t" . $posterRankInfo['name'] . "\n\t\t\t\t<div id='forumShowAvatar'>" . $posterMemberObj->getAvatar($setAvatarWidth . $setAvatarWidthUnit, $setAvatarHeight . $setAvatarHeightUnit) . "</div>\n\t\t\t\t<div id='forumShowPostCount'>Posts: " . $posterMemberObj->countForumPosts() . "</div>\n\t\t\t\t" . $dispRankIMG . "\n\t\t\t\t<div id='forumShowMedals'>" . $dispMedals . "</div>\n\t\t\t</div>\n\t\t\t<div class='forumPostMessageInfo main'>\n\t\t\t\t<div class='dottedLine tinyFont'>Posted" . $dispPostedOn . " " . getPreciseTime($postInfo['dateposted']) . "</div><br>\n\t\t\t\t\n\t\t\t\n\t\t\t\t" . $dispForumPostText . $dispLastEdit . "\n\t\t\t\t\n\t\t\t\n\t\t\t</div>\n\t\t\t<div class='forumPostNewSection'></div>\n\t\t\t<div class='forumPostPosterInfo'></div>\n\t\t\t<div class='forumPostMessageExtras'>\n\t\t\t\t";
$arrAttachments = $this->getPostAttachments();
if (count($arrAttachments) > 0 && $blnShowAttachments) {
    echo "\n\t\t\t\t<div class='forumAttachmentsContainer'>\n\t\t\t\t\t<b>Attachments:</b><br>\n\t\t\t\t\t";
    foreach ($arrAttachments as $downloadID) {
        $attachmentObj->select($downloadID);
        $attachmentInfo = $attachmentObj->get_info_filtered();
        $addS = $attachmentInfo['downloadcount'] != 1 ? "s" : "";
        $dispFileSize = $attachmentInfo['filesize'] / 1024;
        if ($dispFileSize < 1) {
            $dispFileSize = $attachmentInfo['filesize'] . "B";
        } elseif ($dispFileSize / 1024 < 1) {
            $dispFileSize = round($dispFileSize, 2) . "KB";
        } else {
            $dispFileSize = round($dispFileSize / 1024, 2) . "MB";
        }
        echo "<a href='" . $MAIN_ROOT . "downloads/file.php?dID=" . $downloadID . "'>" . $attachmentInfo['filename'] . "</a> - downloaded " . $attachmentInfo['downloadcount'] . " time" . $addS . " - " . $dispFileSize . "<br>";
    }
    echo "\n\t\t\t\t\t</div>\n\t\t\t\t\t";
}
if ($postMemberInfo['forumsignature'] != "" && $websiteInfo['forum_hidesignatures'] == 0) {