* Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ include_once "../../../../_setup.php"; $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $medalObj = new Medal($mysqli); $consoleObj = new ConsoleOption($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Medals"); $consoleObj->select($cID); $_GET['cID'] = $cID; if ($member->authorizeLogin($_SESSION['btPassword'])) { $memberInfo = $member->get_info_filtered(); if ($member->hasAccess($consoleObj) && $medalObj->select($_POST['itemID'])) { define("LOGGED_IN", true); if ($_POST['confirm'] == 1) { $medalObj->delete(); $objManageList = new btOrderManageList($medalObj); $objManageList->strMainListLink = BASE_DIRECTORY . "members/include/admin/medals/main.php"; include $objManageList->strMainListLink; include BASE_DIRECTORY . "members/console.managelist.list.php"; } else { $medalName = $medalObj->get_info_filtered("name"); echo "<p align='center'>Are you sure you want to delete the medal <b>" . $medalName . "</b>?</p>"; } } elseif (!$medalObj->select($_POST['itemID'])) { echo "<p align='center'>Unable find the selected medal. Please try again or contact the website administrator.</p>"; } }
<?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 * */ include_once "../../../_setup.php"; include_once "../../../classes/member.php"; include_once "../../../classes/medal.php"; $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $memberObj = new Member($mysqli); $medalObj = new Medal($mysqli); $medalOptions = "<option value=''>Select</option>"; if ($member->authorizeLogin($_SESSION['btPassword']) && $memberObj->select($_POST['mID'])) { $arrMedals = $memberObj->getMedalList(); foreach ($arrMedals as $medalID) { $medalObj->select($medalID); $medalInfo = $medalObj->get_info_filtered(); $medalOptions .= "<option value='" . $medalInfo['medal_id'] . "'>" . $medalInfo['name'] . "</option>"; } } echo $medalOptions;
public function awardMedal($medalID, $reason = "") { $returnVal = false; if ($this->intTableKeyValue != "") { $medal = new Medal($this->MySQL); $medalList = $this->getMedalList(); if ($medal->select($medalID) && !in_array($medalID, $medalList)) { $medalMemberObj = new Basic($this->MySQL, "medals_members", "medalmember_id"); $arrColumns = array("member_id", "medal_id", "dateawarded", "reason"); $arrValues = array($this->intTableKeyValue, $medalID, time(), $reason); if ($medalMemberObj->addNew($arrColumns, $arrValues)) { $this->postNotification("You were awarded the medal: <b>" . $medal->get_info_filtered("name") . "</b>"); } } } return $returnVal; }
* */ 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/medal.php"; $cID = $_GET['cID']; $medalObj = new Medal($mysqli); if (!$medalObj->select($_GET['mID'])) { die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "members';</script>"); } $medalInfo = $medalObj->get_info_filtered(); $breadcrumbObj->popCrumb(); $breadcrumbObj->addCrumb("Manage Medals", $MAIN_ROOT . "members/console.php?cID=" . $cID); $breadcrumbObj->addCrumb($medalInfo['name']); echo "\n\n<script type='text/javascript'>\n\$(document).ready(function() {\n\$('#breadCrumb').html(\"" . $breadcrumbObj->getBreadcrumb() . "\");\n});\n</script>\n"; $arrMedals = $medalObj->get_entries(array(), "ordernum DESC"); $medalOptions = array(); foreach ($arrMedals as $eachMedalInfo) { $medalName = filterText($eachMedalInfo['name']); $medalOptions[$eachMedalInfo['medal_id']] = $medalName; } if (count($medalOptions) == 0) { $medalOptions['first'] = "(first medal)";
while ($row = $result->fetch_assoc()) { $arrRanks[] = $row['rank_id']; } $sqlRanks = "('" . implode("','", $arrRanks) . "')"; $result = $mysqli->query("SELECT * FROM " . $dbprefix . "members INNER JOIN " . $dbprefix . "ranks ON " . $dbprefix . "members.rank_id = " . $dbprefix . "ranks.rank_id WHERE " . $dbprefix . "members.rank_id IN " . $sqlRanks . " AND " . $dbprefix . "members.disabled = '0' AND " . $dbprefix . "members.member_id != '" . $memberInfo['member_id'] . "' ORDER BY " . $dbprefix . "ranks.ordernum DESC"); while ($row = $result->fetch_assoc()) { $rankObj->select($row['rank_id']); $memberOptions[$row['member_id']] = $rankObj->get_info_filtered("name") . " " . filterText($row['username']); } $result = $mysqli->query("SELECT * FROM " . $dbprefix . "medals ORDER BY ordernum DESC"); while ($row = $result->fetch_assoc()) { $medalOptions[$row['medal_id']] = filterText($row['name']); } echo "\n\t\t<div class='main' id='medalPopUp' style='display: none; position: relative'>\n\t\t\t<div class='loadingSpiral' id='loadingSpiral' style='position: relative'><p align='center'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral2.gif'><br><br><i>Loading...</i></p></div>\n\t\t\t<div id='medalInfoDiv' style='position: relative'></div>\n\t\t\t\n\t\t</div>\n\t\t<script type='text/javascript'>\n\t\t\t\$(document).ready(function() {\n\t\t\t\tvar blnHidePreview = 0;\n\t\t\t\tvar intFirst = 0;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\$('#setShowTrue').click(function() {\n\t\t\t\t\tblnHidePreview = 0;\n\t\t\t\t\tintFirst = 0;\n\t\t\t\t\t\$('#medalselect').change();\n\t\t\t\t\t\$('#reshowDiv').hide();\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\$('#medalselect').change(function() {\n\t\t\t\t\t\n\t\t\t\t\tvar intX = \$('#formDiv').position().left+150+\$('#formDiv').width();\n\t\t\t\t\tvar intY = \$('#formDiv').position().top+(\$('#formDiv').height()/2);\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\$('#medalInfoDiv').hide();\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/medals/medalinfo.php', { medalID: \$('#medalselect').val() }, function(data) {\n\t\t\t\t\t\t\$('#medalInfoDiv').html(data);\n\t\t\t\t\t\t\$('#medalInfoDiv').show();\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\tif(blnHidePreview == 0) {\n\t\t\t\t\t\t\t\$('#medalPopUp').dialog({\n\t\t\t\t\t\t\t\ttitle: 'Medal Information',\n\t\t\t\t\t\t\t\tshow: 'fade',\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\tmodal: false,\n\t\t\t\t\t\t\t\twidth: 150,\n\t\t\t\t\t\t\t\tbeforeClose: function(event, ui) {\n\t\t\t\t\t\t\t\t\tblnHidePreview = 1;\n\t\t\t\t\t\t\t\t\t\$('#reshowDiv').show();\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\t\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\tif(intFirst == 0) { \$('#medalPopUp').dialog({position: [intX,intY]}); intFirst = 1; }\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t});\n\t\t</script>\n\t"; $i = 1; $arrComponents = array("member" => array("type" => "select", "options" => $memberOptions, "attributes" => array("class" => "textBox formInput"), "db_name" => "member_id", "sortorder" => $i++, "display_name" => "Member", "validate" => array("RESTRICT_TO_OPTIONS", array("name" => "IS_SELECTABLE", "selectObj" => $member, "select_back" => "member_id"), array("name" => "NOT_EQUALS_VALUE", "value" => $memberInfo['member_id']))), "medal" => array("type" => "select", "options" => $medalOptions, "attributes" => array("class" => "textBox formInput", "id" => "medalselect"), "db_name" => "medal_id", "sortorder" => $i++, "display_name" => "Medal", "validate" => array("RESTRICT_TO_OPTIONS"), "html" => "<div class='main formInput' style='display: none; padding-left: 10px' id='reshowDiv'><a href='javascript:void(0)' id='setShowTrue'>Show Medal Info</a></div>"), "reason" => array("type" => "textarea", "attributes" => array("class" => "textBox formInput", "rows" => 3, "style" => "width: 35%"), "db_name" => "reason", "sortorder" => $i++, "display_name" => "Reason"), "submit" => array("type" => "submit", "attributes" => array("class" => "submitButton formSubmitButton"), "value" => "Award Medal", "sortorder" => $i++)); if ($_POST['submit']) { $member->select($_POST['member']); $medalObj->select($_POST['medal']); } $setupFormArgs = array("name" => "console-" . $cID, "components" => $arrComponents, "attributes" => array("id" => "formDiv", "action" => $MAIN_ROOT . "members/console.php?cID=" . $cID, "method" => "post"), "afterSave" => array("awardMedalSave"), "saveMessage" => "Successfully awarded " . $member->getMemberLink() . " the medal <b>" . $medalObj->get_info_filtered("name") . "</b>!", "saveObject" => $awardMedalObj, "saveType" => "add", "saveAdditional" => array("dateawarded" => time()), "description" => "Use the form below to award a medal."); // After Save function awardMedalSave() { global $member, $medalObj, $memberInfo; $member->select($_POST['member_id']); $logMessage = $member->getMemberLink() . " was awarded the " . $medalObj->get_info_filtered("name") . " medal.<br><br><b>Reason:</b><br>" . filterText($_POST['reason']); $member->postNotification("You were awarded the medal: <b>" . $medalObj->get_info_filtered("name") . "</b>"); $member->select($memberInfo['member_id']); $member->logAction($logMessage); }
<?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 * */ include_once "../../../_setup.php"; include_once "../../../classes/member.php"; include_once "../../../classes/medal.php"; $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $medalObj = new Medal($mysqli); if ($member->authorizeLogin($_SESSION['btPassword']) && $medalObj->select($_POST['medalID'])) { $medalObj->refreshImageSize(); $medalInfo = $medalObj->get_info_filtered(); echo "\n\t\t<p align='center'>\n\t\t\t<img src='" . $medalInfo['imageurl'] . "' width='" . $medalInfo['imagewidth'] . "' height='" . $medalInfo['imageheight'] . "'>\n\t\t</p>\n\t\t<p align='center'>\n\t\t\t<b><u>" . $medalInfo['name'] . "</u></b><br>\n\t\t\t" . $medalInfo['description'] . "\n\t\t</p>\n\t\n\t"; }
} else { $ipbanObj->delete(); } } // Start Page $PAGE_NAME = "Medals - "; include $prevFolder . "themes/" . $THEME . "/_header.php"; $member = new Member($mysqli); $medalObj = new Medal($mysqli); $breadcrumbObj->setTitle("Medals"); $breadcrumbObj->addCrumb("Home", $MAIN_ROOT); $breadcrumbObj->addCrumb("Medals"); include $prevFolder . "include/breadcrumb.php"; ?> <table class='formTable' style='width: 75%; margin-left: auto; margin-right: auto'> <tr> <td class='formTitle' style='width: 40%'>Medal:</td> <td class='formTitle' style='width: 60%'>Description:</td> </tr> <?php $result = $mysqli->query("SELECT medal_id FROM " . $dbprefix . "medals ORDER BY ordernum DESC"); while ($row = $result->fetch_assoc()) { $medalObj->select($row['medal_id']); $medalObj->refreshImageSize(); $medalInfo = $medalObj->get_info_filtered(); echo "\n\t\t\n\t\t<tr>\n\t\t\t<td class='main' align='center' valign='top'>\n\t\t\t\t<img src='" . $medalInfo['imageurl'] . "' width='" . $medalInfo['imagewidth'] . "' height='" . $medalInfo['imageheight'] . "'>\n\t\t\t</td>\n\t\t\t<td class='main' valign='top'>\n\t\t\t\t<b>" . $medalInfo['name'] . "</b><br>\n\t\t\t\t" . nl2br($medalInfo['description']) . "\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr><td colspan='2'><br></td></tr>\n\t"; } echo "</table>"; include $prevFolder . "themes/" . $THEME . "/_footer.php";
?> </p> <?php if ($dispGoal != "") { $dispDaysLeft = $daysLeft != "" ? "<div class='donationsDaysLeft'>" . $campaignObj->getFormattedEndDate() . " left</div>" : ""; $progressBarColor = $donationPlugin->getConfigInfo("goalprogresscolor") == "" ? "black" : $donationPlugin->getConfigInfo("goalprogresscolor"); $progressBarBackColor = $donationPlugin->getConfigInfo("goalprogressbackcolor") == "" ? "gray" : $donationPlugin->getConfigInfo("goalprogressbackcolor"); echo "\n\t\t\t\t<br>\n\t\t\t\t<div class='donationProgressContainer' style='background-color: " . $progressBarBackColor . "'><div style='background-color: " . $progressBarColor . "; width: " . $goalCompletePercent . "'></div></div>\n\t\t\t\t<div class='main donationGoalText'>" . $goalCompletePercent . $dispDaysLeft . "</div>\n\t\t\t\t" . $dispEndDate . "\n\t\t\t"; } elseif ($daysLeft != "") { echo "\n\t\t\t\t<br>\t\t\n\t\t\t\t<p class='numberCounts'>" . $daysLeft . "</p>\t\t\n\t\t\t\t<p class='main'>" . pluralize("day", $daysLeft) . " left</p>\t\t\n\t\t\t"; } if ($campaignInfo['description'] != "") { echo "\n\t\t\t\t<br>\n\t\t\t\t<div class='dottedLine largeFont' style='margin-top: 15px'><b>Campaign Description:</b></div>\n\t\t\t\t<div class='main' style='padding-top: 3px'>" . $campaignInfo['description'] . "</div>\n\t\t\t"; } $medalObj = new Medal($mysqli); if ($campaignInfo['awardmedal'] != 0 && $medalObj->select($campaignInfo['awardmedal'])) { $medalInfo = $medalObj->get_info_filtered(); $dispStyle = $medalInfo['imagewidth'] != 0 ? "width: " . $medalInfo['imagewidth'] . "px;" : ""; $dispStyle .= $medalInfo['imageheight'] != 0 ? "height: " . $medalInfo['imageheight'] . "px;" : ""; $dispStyle = $dispStyle != "" ? " style='" . $dispStyle . "'" : ""; echo "\n\t\t\t\t<br>\n\t\t\t\t<div class='dottedLine largeFont' style='margin-top: 15px'><b>Member Reward:</b></div>\n\t\t\t\t<div class='main' style='padding-top: 3px'>Members who donate to this campaign will receive:</div>\n\t\t\t\t<br>\n\t\t\t\t<p class='main' align='center'><img src='" . $medalInfo['imageurl'] . "'" . $dispStyle . "><br>" . $medalInfo['name'] . "</p>\n\t\t\t"; } ?> <br> <div class='dottedLine largeFont' style='margin-top: 15px'><b>Donators:</b></div> <?php $campaignObj->showDonatorList(); ?> </div> <div style='clear: both'></div>
<?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 * */ 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; } } $cID = $_GET['cID']; $medalObj = new Medal($mysqli); $objManageList = new btOrderManageList($medalObj); $objManageList->strMainListLink = BASE_DIRECTORY . "members/include/admin/medals/main.php"; if ($_GET['mID'] != "" && $medalObj->select($_GET['mID']) && $_GET['action'] == "edit") { include "medals/edit.php"; } elseif ($_GET['action'] != "move") { include $objManageList->strMainListLink; }