コード例 #1
0
ファイル: manageimages.php プロジェクト: nsystem1/clanscripts
 * 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
 *
 */
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/imageslider.php";
$cID = $_GET['cID'];
$imageSliderObj = new ImageSlider($mysqli);
if ($_GET['action'] == "edit" && $imageSliderObj->select($_GET['imgID'])) {
    include "include/news/include/editimage.php";
} else {
    $addImageCID = $consoleObj->findConsoleIDByName("Add Home Page Image");
    $selectWidthUnit = $websiteInfo['hpimagewidthunit'] == "px" ? "" : " selected";
    $selectHeightUnit = $websiteInfo['hpimageheightunit'] == "px" ? "" : " selected";
    $selectDisplayStyle = $websiteInfo['hpimagetype'] == "slider" ? "" : " selected";
    echo "\n\t\t\t<div class='formDiv'>\n\t\t\t\tUse this page to manage the home page image slider.  You can attach news posts, tournaments, events or any kind of custom message that you want to the images in the image slider.\n\t\t\t\t\n\t\t\t\t<div id='errorDiv' style='display: none' class='errorDiv'>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<table class='formTable'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='main' colspan='2' align='right'><b>&raquo;</b> <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $addImageCID . "'>Add New Image</a> <b>&laquo;</b></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='main' colspan='2'>\n\t\t\t\t\t\t\t<div class='dottedLine' style='margin-bottom: 3px; padding-bottom: 2px'><b>Display Settings:</b></div>\n\t\t\t\t\t\t\t\tUse this section to modify the settings for home page images.<br><br>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Width:</td>\n\t\t\t\t\t\t<td class='main'><input type='text' id='containerwidth' value='" . $websiteInfo['hpimagewidth'] . "' class='textBox' style='width: 50px'> <select id='containerwidthunit' class='textBox'><option value='1'>px</option><!-- <option value='2'" . $selectWidthUnit . ">%</option> --></select></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Height:</td>\n\t\t\t\t\t\t<td class='main'><input type='text' id='containerheight' value='" . $websiteInfo['hpimageheight'] . "' class='textBox' style='width: 50px'> <select id='containerheightunit' class='textBox'><option value='1'>px</option><!-- <option value='2'" . $selectHeightUnit . ">%</option> --></select></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Display Style:</td>\n\t\t\t\t\t\t<td class='main'><select id='displaystyle' class='textBox'><option value='slider'>Image Slider</option><option value='random'" . $selectDisplayStyle . ">Random Images</option></select></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='main' align='center' colspan='2'><br>\n\t\t\t\t\t\t\t<input type='button' id='btnSaveSettings' class='submitButton' value='Save'>\n\t\t\t\t\t\t\t<div class='main' style='text-align: center; margin-top: 10px; display: none' id='saveLoading'>\n\t\t\t\t\t\t\t\tSaving...\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style='text-align: center; margin-top: 10px; display: none' id='saveSuccess' class='successFont'>\n\t\t\t\t\t\t\t\t<b>Saved!</b>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='main' colspan='2'>\n\t\t\t\t\t\t\t<div class='dottedLine' style='margin-top: 50px; margin-bottom: 3px; padding-bottom: 2px'><b>Images:</b></div><br>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='main' colspan='2'>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<table class='formTable'>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='formTitle' style='width: 76%'>Image Name:</td>\n\t\t\t\t\t\t\t\t\t<td class='formTitle' style='width: 24%'>Actions:</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t<div id='loadingSpiral' class='loadingSpiral'>\n\t\t\t\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral.gif'><br>Loading\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id='imageList'></div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div id='deleteMessage' style='display: none'></div>\n\t\t\t<div id='saveDump' style='display: none'></div>\n\t\t\t<script type='text/javascript'>\n\t\t\t\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$('#loadingSpiral').show();\t\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/news/include/imagelist.php', { }, function(data) {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#imageList').html(data);\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\$('#btnSaveSettings').click(function() {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#errorDiv').hide();\n\t\t\t\t\t\t\$('#saveLoading').show();\n\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/news/include/imageslider_savesettings.php', { containerWidth: \$('#containerwidth').val(), containerHeight: \$('#containerheight').val(), containerWidthUnit: \$('#containerwidthunit').val(), containerHeightUnit: \$('#containerheightunit').val(), displayStyle: \$('#displaystyle').val() }, function(data) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$('#saveDump').html(data);\n\t\t\t\t\t\t\t\$('#saveLoading').hide();\n\t\t\t\t\t\t\n\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\t\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfunction moveImg(intID, strDir) {\n\t\t\t\t\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\t\$('#imageList').fadeOut(200);\n\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/news/include/move_image.php', { imgID: intID, iDir: strDir }, function(data) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$('#imageList').html(data);\n\t\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\t\$('#imageList').fadeIn(200);\n\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\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfunction deleteImg(intID) {\n\t\t\t\t\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\n\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/news/include/delete_image.php', { imgID: intID }, function(data) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$('#deleteMessage').html(data);\n\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\n\t\t\t\t}\n\t\t\t\n\t\t\t</script>\n\t\t\t\n\t\t\t\n\t\t";
}
コード例 #2
0
ファイル: delete_image.php プロジェクト: nsystem1/clanscripts
 * Copyright 2014
 *
 * Author: Bluethrust Web Development
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/imageslider.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$imageSliderObj = new ImageSlider($mysqli);
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Home Page Images");
$consoleObj->select($cID);
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $imageSliderObj->select($_POST['imgID'])) {
        $imageSliderInfo = $imageSliderObj->get_info_filtered();
        if (isset($_POST['confirm'])) {
            unlink("../../../../" . $imageSliderInfo['imageurl']);
            $imageSliderObj->delete();
            include "imagelist.php";
        } else {
            echo "\n\t\t\t\n\t\t\t\t<div id='confirmDeleteImage' style='display: none'>\n\t\t\t\t\t<p class='main' align='center'>\n\t\t\t\t\t\tAre you sure you want to delete <b>" . $imageSliderInfo['name'] . "</b>?\n\t\t\t\t\t</p>\n\t\t\t\t</div>\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\$('#confirmDeleteImage').dialog({\n\t\t\t\t\t\t\ttitle: 'Confirm Delete - Home Page Image',\n\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\tzIndex: 999999,\n\t\t\t\t\t\t\tresizable: false,\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'Yes': function() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\t\t\t\t\$('#imageList').fadeOut(200);\n\t\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/news/include/delete_image.php', { imgID: '" . $_POST['imgID'] . "', confirm: 1 }, function(data) {\n\t\t\t\t\t\t\t\t\t\t\$('#imageList').html(data);\n\t\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\t\t\t\t\$('#imageList').fadeIn(200);\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\t\t\$(this).dialog('close');\n\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\t'Cancel': 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</script>\n\t\t\t\n\t\t\t";
        }
    }
}