<?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;
$userData = array(); $user->email = StringUtil::scrambleEmail($user->email); // Find the rank of this user by number of words and number of characters $topWords = TopEntry::getTopData(CRIT_WORDS, SORT_DESC, true); $numUsers = count($topWords); $rankWords = 0; while ($rankWords < $numUsers && $topWords[$rankWords]->userNick != $nick) { $rankWords++; } $userData['rank_words'] = $rankWords + 1; if ($rankWords < $numUsers) { $topEntry = $topWords[$rankWords]; $userData['last_submission'] = $topEntry->timestamp; $userData['num_words'] = $topEntry->numDefinitions; $userData['num_chars'] = $topEntry->numChars; } $topChars = TopEntry::getTopData(CRIT_CHARS, SORT_DESC, true); $numUsers = count($topChars); $rankChars = 0; while ($rankChars < $numUsers && $topChars[$rankChars]->userNick != $nick) { $rankChars++; } $userData['rank_chars'] = $rankChars + 1; SmartyWrap::assign('medals', Medal::loadForUser($user)); if (util_isModerator(PRIV_ADMIN)) { // Admins can grant/revoke medals SmartyWrap::assign('allMedals', Medal::$DATA); } SmartyWrap::assign('user', $user); SmartyWrap::assign('userData', $userData); SmartyWrap::display('user.tpl');
/* * 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"; $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 {
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; }
* 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/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) {
$rankInfo['promotepower'] = $memberInfo['promotepower']; } elseif ($memberInfo['promotepower'] == -1) { $rankInfo['promotepower'] = 0; } $cID = $_GET['cID']; if ($memberInfo['rank_id'] == 1) { $maxOrderNum = $mysqli->query("SELECT MAX(ordernum) FROM " . $dbprefix . "ranks WHERE rank_id != '1'"); $arrMaxOrderNum = $maxOrderNum->fetch_array(MYSQLI_NUM); if ($maxOrderNum->num_rows > 0) { $result = $mysqli->query("SELECT rank_id FROM " . $dbprefix . "ranks WHERE ordernum = '" . $arrMaxOrderNum[0] . "'"); $row = $result->fetch_assoc(); $rankInfo['promotepower'] = $row['rank_id']; } } $rankObj = new Rank($mysqli); $medalObj = new Medal($mysqli); $awardMedalObj = new Basic($mysqli, "medals_members", "medalmember_id"); $rankObj->select($rankInfo['promotepower']); $maxRankInfo = $rankObj->get_info_filtered(); if ($rankInfo['rank_id'] == 1) { $maxRankInfo['ordernum'] += 1; } $arrRanks = array(); $result = $mysqli->query("SELECT * FROM " . $dbprefix . "ranks WHERE ordernum <= '" . $maxRankInfo['ordernum'] . "' AND rank_id != '1' ORDER BY ordernum DESC"); 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']);
<?php if (!defined("SHOW_PROFILE_MAIN")) { exit; } // MEDALS $arrMedals = $member->getMedalList(false, $websiteInfo['medalorder']); $medalObj = new Medal($mysqli); if (count($arrMedals) > 0) { foreach ($arrMedals as $medalID) { $medalObj->select($medalID); $medalInfo = $medalObj->get_info_filtered(); if ($medalInfo['imagewidth'] == 0) { $imgInfo = getimagesize($medalObj->getLocalImageURL()); $medalInfo['imagewidth'] = $imgInfo[0]; } if ($medalInfo['imageheight'] == 0) { $imgInfo = getimagesize($medalObj->getLocalImageURL()); $medalInfo['imageheight'] = $imgInfo[1]; } $result = $mysqli->query("SELECT * FROM " . $dbprefix . "medals_members WHERE member_id = '" . $memberInfo['member_id'] . "' AND medal_id = '" . $medalInfo['medal_id'] . "'"); $row = $result->fetch_assoc(); $dispDateAwarded = "<b>Date Awarded:</b><br>" . getPreciseTime($row['dateawarded']); $dispReason = ""; if ($row['reason'] != "") { $dispReason = "<br><br><b>Awarded for:</b><br>" . filterText($row['reason']); } $dispMedalMessage = "<b>" . $medalInfo['name'] . "</b><br><br>" . $dispDateAwarded . $dispReason; $tempArr = array("width" => $medalInfo['imagewidth'], "height" => $medalInfo['imageheight'], "url" => $medalInfo['imageurl'], "message" => $dispMedalMessage); $arrDispMedals[] = $tempArr; }
<?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"; }
$rankInfo['promotepower'] = 0; } $cID = $_GET['cID']; $dispError = ""; $countErrors = 0; if ($memberInfo['rank_id'] == 1) { $maxOrderNum = $mysqli->query("SELECT MAX(ordernum) FROM " . $dbprefix . "ranks WHERE rank_id != '1'"); $arrMaxOrderNum = $maxOrderNum->fetch_array(MYSQLI_NUM); if ($maxOrderNum->num_rows > 0) { $result = $mysqli->query("SELECT rank_id FROM " . $dbprefix . "ranks WHERE ordernum = '" . $arrMaxOrderNum[0] . "'"); $row = $result->fetch_assoc(); $rankInfo['promotepower'] = $row['rank_id']; } } $rankObj = new Rank($mysqli); $medalObj = new Medal($mysqli); $rankObj->select($rankInfo['promotepower']); $maxRankInfo = $rankObj->get_info_filtered(); if ($rankInfo['rank_id'] == 1) { $maxRankInfo['ordernum'] += 1; } $arrRanks = array(); $result = $mysqli->query("SELECT * FROM " . $dbprefix . "ranks WHERE ordernum < '" . $maxRankInfo['ordernum'] . "' AND rank_id != '1' ORDER BY ordernum DESC"); 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, " . $dbprefix . "members.username"); while ($row = $result->fetch_assoc()) { $rankObj->select($row['rank_id']); $memberOptions[$row['member_id']] = $rankObj->get_info_filtered("name") . " " . filterText($row['username']);
include_once $prevFolder . "classes/medal.php"; // Classes needed for index.php $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(); } } // 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()) {
<?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"; $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); $medalObj->move($_POST['moveDir']); include "main.php"; include "../../../console.managelist.list.php"; } }
log_scriptLog("Granting {$user->nick} a MEDAL_VOLUNTEER_5"); $user->medalMask |= Medal::MEDAL_VOLUNTEER_5; } else { if ($e->numChars >= 1000000 && $e->numChars < 10000000 && !($user->medalMask & Medal::MEDAL_VOLUNTEER_4)) { log_scriptLog("Granting {$user->nick} a MEDAL_VOLUNTEER_4"); $user->medalMask |= Medal::MEDAL_VOLUNTEER_4; } else { if ($e->numChars >= 100000 && $e->numChars < 1000000 && !($user->medalMask & Medal::MEDAL_VOLUNTEER_3)) { log_scriptLog("Granting {$user->nick} a MEDAL_VOLUNTEER_3"); $user->medalMask |= Medal::MEDAL_VOLUNTEER_3; } else { if ($e->numChars >= 10000 && $e->numChars < 100000 && !($user->medalMask & Medal::MEDAL_VOLUNTEER_2)) { log_scriptLog("Granting {$user->nick} a MEDAL_VOLUNTEER_2"); $user->medalMask |= Medal::MEDAL_VOLUNTEER_2; } else { if ($e->numChars >= 1000 && $e->numChars < 10000 && !($user->medalMask & Medal::MEDAL_VOLUNTEER_1)) { log_scriptLog("Granting {$user->nick} a MEDAL_VOLUNTEER_1"); $user->medalMask |= Medal::MEDAL_VOLUNTEER_1; } } } } } $user->medalMask = Medal::getCanonicalMask($user->medalMask); if (!$dryRun) { $user->save(); } } } log_scriptLog("updateMedals: ending"); /*********************************************************************/
echo $dispGoal; ?> </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>
<?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; }