Exemple #1
0
function displayDonationMenuModule()
{
    $menuItemInfo = $GLOBALS['menu_item_info'];
    if ($menuItemInfo['itemtype'] != "donation") {
        return false;
    }
    global $mysqli;
    if (!class_exists("DonationCampaign")) {
        include BASE_DIRECTORY . "plugins/donations/classes/campaign.php";
    }
    $campaignObj = new DonationCampaign($mysqli);
    $donationObj = new btPlugin($mysqli);
    if ($campaignObj->select($menuItemInfo['itemtype_id']) && $donationObj->selectByName("Donations")) {
        $progressBarColor = $donationObj->getConfigInfo("goalprogresscolor");
        $progressBarBackColor = $donationObj->getConfigInfo("goalprogressbackcolor");
        $campaignInfo = $campaignObj->get_info_filtered();
        $campaignDesc = $campaignObj->get_info("description");
        $dispCampaignDesc = substr($campaignDesc, 0, 100);
        $dispCampaignDesc = $campaignDesc != $dispCampaignDesc ? $dispCampaignDesc . "..." : $dispCampaignDesc;
        $dispCampaignDesc = nl2br(parseBBCode(filterText($dispCampaignDesc)));
        $daysLeft = "";
        if ($campaignInfo['dateend'] != 0 || $campaignInfo['dateend'] == 0 && $campaignInfo['currentperiod'] != 0) {
            $daysLeft = $campaignObj->getDaysLeft();
        }
        $dispGoal = "";
        if ($campaignInfo['goalamount'] > 0) {
            // Graph
            $goalCompletePercent = round($campaignObj->getTotalDonationAmount() / $campaignInfo['goalamount'] * 100);
            $goalCompletePercent = $goalCompletePercent > 100 ? "100%" : $goalCompletePercent . "%";
            $dispGoal = " of " . $campaignObj->formatAmount($campaignInfo['goalamount'], 2) . " goal";
            $dispProgressBar = "\n\t\t\t\t\t<div class='donationProgressContainer' style='background-color: " . $progressBarBackColor . "'>\n\t\t\t\t\t\t<div style='width: " . $goalCompletePercent . "; background-color: " . $progressBarColor . "'></div>\n\t\t\t\t\t</div>\n\t\t\t\t";
        }
        $donationsInfo = $campaignObj->getDonationInfo();
        $totalDonations = count($donationsInfo);
        $donationsFormatted = $campaignObj->formatAmount($campaignObj->getTotalDonationAmount());
        $currentEndDate = $campaignObj->getCurrentEndDate();
        $dispEndingDate = "";
        if ($currentEndDate != 0) {
            $dispExclaimation = $daysLeft < 3 ? "!" : "";
            $dispEndingDate = "<div class='donateMenuItemStat'><b>" . $campaignObj->getFormattedEndDate() . " left" . $dispExclaimation . "</b></div>";
        }
        echo "\n\t\t\t\n\t\t\t\t<div class='donateMenuItemContainer'>\n\t\t\t\t\t<div class='donateMenuItemTitle'><a href='" . $campaignObj->getLink() . "'>" . $campaignInfo['title'] . "</a></div>\n\t\t\t\t\t<div class='donateMenuItemDesc main'>\n\t\t\t\t\t\t" . $dispCampaignDesc . "\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\t<a href='" . $campaignObj->getLink() . "'><input type='button' value='Donate!' class='submitButton'></a>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div class='donateMenuItemStatsDiv main'>" . $dispProgressBar . "\n\t\t\t\t\t\t<div class='donateMenuItemStat'><b>" . $donationsFormatted . "</b><br>raised" . $dispGoal . "</div>\n\t\t\t\t\t\t" . $dispEndingDate . "\n\t\t\t\t\t\t<div style='clear: both'></div>\n\t\t\t\t\t</div>\n\t\t\t";
        if (count($donationsInfo) > 0) {
            echo "<p class='donateMenuItemTitle'><b>Latest Donators:</b></p>";
            $campaignObj->showDonatorList(false, 2);
        }
        echo "\n\t\t\t\t</div>\n\t\t\t\n\t\t\t";
    }
}
<?php

if (!defined("CAMPAIGN_FORM")) {
    exit;
}
$arrPaypalCurrencyCodes = $campaignObj->getCurrencyCodes();
$arrPaypalCurrencyInfo = $campaignObj->getCurrencyCodeInfo();
$donationPlugin = new btPlugin($mysqli);
$donationPlugin->selectByName("Donations");
$checkRecurringBox = $setRecurringBox == 1 ? 1 : 0;
$campaignJS = "\n\t\n\t\t\$(document).ready(function() {\n\t\t\tvar recurring = " . $checkRecurringBox . ";\n\t\t\n\t\t\t\$('#chkRecurring').click(function() {\n\t\t\t\tif(recurring == 1) {\n\t\t\t\t\t\$('#repeatPeriodAmount').attr('disabled', 'disabled');\n\t\t\t\t\t\$('#repeatPeriodUnit').attr('disabled', 'disabled');\n\t\t\t\t\trecurring = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t\$('#repeatPeriodAmount').attr('disabled', false);\n\t\t\t\t\t\$('#repeatPeriodUnit').attr('disabled', false);\n\t\t\t\t\trecurring = 1;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t\$('#runUntil').change(function() {\n\t\t\t\n\t\t\t\tif(\$(this).val() == \"choose\") {\n\t\t\t\t\t\$('#jsEndDate').show();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t\$('#jsEndDate').hide();\n\t\t\t\t}\n\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\t\$('#runUntil').change();\n\t\t});\n\t";
$maxYear = date("Y") + 10;
$maxDate = "new Date(" . $maxYear . ",12,31)";
$i = 0;
$arrComponents = array("mainsection" => array("type" => "section", "options" => array("section_title" => "General Information"), "sortorder" => $i++), "title" => array("type" => "text", "attributes" => array("class" => "textBox bigTextBox formInput"), "sortorder" => $i++, "display_name" => "Title", "db_name" => "title", "validate" => array("NOT_BLANK")), "description" => array("type" => "textarea", "display_name" => "Description", "attributes" => array("class" => "textBox formInput bigTextBox", "rows" => 5), "sortorder" => $i++, "db_name" => "description"), "rununtil" => array("type" => "select", "display_name" => "Run Until", "options" => array("forever" => "Forever", "choose" => "Choose Date"), "attributes" => array("class" => "textBox formInput", "id" => "runUntil"), "sortorder" => $i++), "enddate" => array("type" => "datepicker", "sortorder" => $i++, "attributes" => array("style" => "cursor: pointer; display: none", "id" => "jsEndDate", "class" => "textBox formInput"), "db_name" => "dateend", "before_html" => "<label class='formLabel' style='display: inline-block'></label>\n\t\t\t", "options" => array("changeMonth" => "true", "changeYear" => "true", "dateFormate" => "M d, yy", "minDate" => "new Date(50, 1, 1)", "maxDate" => $maxDate, "yearRange" => "1950:" . $maxYear, "altField" => "realEndDate"), "validate" => array("NUMBER_ONLY"), "value" => 0), "allowname" => array("type" => "checkbox", "display_name" => "Allow Names", "tooltip" => "Check this box to allow donators to leave their name.", "sortorder" => $i++, "value" => 1, "options" => array(1 => ""), "attributes" => array("class" => "formInput"), "db_name" => "allowname"), "allowmessage" => array("type" => "checkbox", "display_name" => "Allow Messages", "tooltip" => "Check this box to allow donators to leave a message.", "sortorder" => $i++, "value" => 1, "options" => array(1 => ""), "attributes" => array("class" => "formInput"), "db_name" => "allowmessage"), "allowhiddenamount" => array("type" => "checkbox", "display_name" => "Allow Hidden Amounts", "tooltip" => "Check this box to allow donators to hide the amount they donated on the donation profile page.  You will still be able to view the amount in the donation logs.", "sortorder" => $i++, "value" => 0, "options" => array(1 => ""), "attributes" => array("class" => "formInput"), "db_name" => "allowhiddenamount"), "goalamount" => array("type" => "text", "attributes" => array("class" => "formInput textBox smallTextBox"), "sortorder" => $i++, "display_name" => "Donation Goal", "db_name" => "goalamount"), "minimumamount" => array("type" => "text", "attributes" => array("class" => "formInput textBox smallTextBox"), "sortorder" => $i++, "display_name" => "Minimum Donation", "value" => "1.00", "db_name" => "minimumamount"), "currency" => array("type" => "select", "attributes" => array("class" => "formInput textBox"), "sortorder" => $i++, "display_name" => "Currency", "db_name" => "currency", "options" => $arrPaypalCurrencyCodes, "value" => $donationPlugin->getConfigInfo("currency")));
// Check for award medal console access
$awardMedalCID = $consoleObj->findConsoleIDByName("Award Medal");
$consoleObj->select($awardMedalCID);
$hasAwardMedalAccess = false;
if ($member->hasAccess($consoleObj)) {
    $hasAwardMedalAccess = true;
    $medalOptions[0] = "None";
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "medals ORDER BY ordernum DESC");
    while ($row = $result->fetch_assoc()) {
        $medalOptions[$row['medal_id']] = filterText($row['name']);
    }
    $arrComponents['awardmedal'] = array("type" => "select", "display_name" => "Award Medal", "sortorder" => $i++, "tooltip" => "Auto-award a medal to a member who donates.", "attributes" => array("class" => "formInput textBox"), "db_name" => "awardmedal", "options" => $medalOptions);
}
$consoleObj->select($cID);
if (!is_array($arrSelectRecur)) {
    $arrSelectRecur['months'] = "selected";
Exemple #3
0
$consoleInfo = $consoleObj->get_info_filtered();
$consoleTitle = $consoleInfo['pagetitle'];
$pluginObj = new btPlugin($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$prevFolder = "../../";
$PAGE_NAME = "Facebook Login - " . $consoleTitle . " - ";
$dispBreadCrumb = "<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>" . $consoleTitle . "</a> > Facebook Login Settings";
$EXTERNAL_JAVASCRIPT .= "\n<script type='text/javascript' src='" . $MAIN_ROOT . "members/js/console.js'></script>\n<script type='text/javascript' src='" . $MAIN_ROOT . "members/js/main.js'></script>\n";
include "../../themes/" . $THEME . "/_header.php";
echo "\n<div class='breadCrumbTitle' id='breadCrumbTitle'>Facebook Login Settings</div>\n<div class='breadCrumb' id='breadCrumb' style='padding-top: 0px; margin-top: 0px'>\n{$dispBreadCrumb}\n</div>\n";
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $fbObj = new Facebook($mysqli);
    $pluginObj->selectByName("Facebook Login");
    if ($_POST['submit']) {
        $arrAPIKey = array('appID' => $_POST['appid'], 'appSecret' => $_POST['appsecret']);
        $jsonAPIKey = json_encode($arrAPIKey);
        if ($pluginObj->update(array("apikey"), array($jsonAPIKey))) {
            echo "\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\tSuccessfully Saved Facebook Login Settings!\n\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Facebook Login', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t\t</script>\n\t\t\t\t\n\t\t\t";
            $member->logAction("Changed Facebook Login Plugin Settings.");
        } else {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to database! Please contact the website administrator.<br>";
        }
    }
    if (!$_POST['submit']) {
        $dispNote = "";
        $arrFacebookAPIKeys = array("App ID" => $fbObj->getAppID(), "App Secret" => $fbObj->getAppSecret());
        foreach ($arrFacebookAPIKeys as $key => $value) {
Exemple #4
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
 *
 */
$prevFolder = "../";
include "../_setup.php";
$pluginObj = new btPlugin($mysqli);
if (!isset($_GET['plugin']) || !$pluginObj->selectByName($_GET['plugin'])) {
    echo "<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "';";
    exit;
}
$pluginInfo = $pluginObj->get_info_filtered();
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Plugin Manager");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$consoleTitle = $consoleInfo['pagetitle'];
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$PAGE_NAME = $pluginInfo['name'] . " Plugin Settings - " . $consoleTitle . " - ";
$EXTERNAL_JAVASCRIPT .= "\n<script type='text/javascript' src='" . $MAIN_ROOT . "members/js/console.js'></script>\n<script type='text/javascript' src='" . $MAIN_ROOT . "members/js/main.js'></script>\n";
$formObj = new Form();
Exemple #5
0
<?php

header("Content-type: text/css");
include "../../_setup.php";
include BASE_DIRECTORY . "themes/" . $THEME . "/css.php";
if ($arrCSSInfo['box-bg-image'] != "none") {
    $arrCSSInfo['box-bg-image'] = substr($arrCSSInfo['box-bg-image'], strlen("url('"));
    $arrCSSInfo['box-bg-image'] = substr($arrCSSInfo['box-bg-image'], 0, strlen($arrCSSInfo['box-bg-image']) - 2);
}
$pluginObj = new btPlugin($mysqli);
$pluginObj->selectByName("Twitch");
$streamWidth = $pluginObj->getConfigInfo("stream_width") != "" ? $pluginObj->getConfigInfo("stream_width") : 640;
$streamHeight = $pluginObj->getConfigInfo("stream_height") != "" ? $pluginObj->getConfigInfo("stream_height") : 360;
$streamChatHeight = $pluginObj->getConfigInfo("streamchat_width") != "" ? $pluginObj->getConfigInfo("streamchat_height") : 300;
?>
.streamPageContainer {
	position: relative;
	overflow: auto;
	margin: 0px auto;
	width: 98%;
}

.twitchCardContainer {
	max-width: 320px;
	width: 26%;
	display: inline-block;
	padding: 10px;
	border: solid <?php 
echo $arrCSSInfo['default-border-color'];
?>
 1px;
Exemple #6
0
$consoleTitle = $consoleInfo['pagetitle'];
$pluginObj = new btPlugin($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$prevFolder = "../../";
$PAGE_NAME = "Twitter Connect - " . $consoleTitle . " - ";
$dispBreadCrumb = "<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>" . $consoleTitle . "</a> > Twitter Connect Settings";
$EXTERNAL_JAVASCRIPT .= "\n<script type='text/javascript' src='" . $MAIN_ROOT . "members/js/console.js'></script>\n<script type='text/javascript' src='" . $MAIN_ROOT . "members/js/main.js'></script>\n";
include "../../themes/" . $THEME . "/_header.php";
echo "\n<div class='breadCrumbTitle' id='breadCrumbTitle'>Twitter Connect Settings</div>\n<div class='breadCrumb' id='breadCrumb' style='padding-top: 0px; margin-top: 0px'>\n{$dispBreadCrumb}\n</div>\n";
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $twitterObj = new Twitter($mysqli);
    $memberInfo = $member->get_info_filtered();
    $pluginObj->selectByName("Twitter Connect");
    //$result = $mysqli->query("SELECT * FROM ".$dbprefix."plugins WHERE name = 'Twitter Connect'");
    $pluginInfo = $pluginObj->get_info();
    $pluginObj->pluginPage->setCategoryKeyValue($pluginInfo['plugin_id']);
    $pluginPageInfo = $pluginObj->getPluginPage("profile", $pluginInfo['plugin_id']);
    $arrProfileModules = array("User Information", "Custom Profile Options", "Games Statistics", "Squads", "Medals");
    $countErrors = 0;
    $dispError = "";
    if ($_POST['submit']) {
        // Check Display Order (before/after)
        if ($_POST['beforeafter'] != "before" && $_POST['beforeafter'] != "after") {
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid display order (before/after).<br>";
            $countErrors++;
        }
        // Check Display Order
        if (!in_array($_POST['displayorder'], array_keys($arrProfileModules))) {
Exemple #7
0
$consoleTitle = $consoleInfo['pagetitle'];
$pluginObj = new btPlugin($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$prevFolder = "../../";
$PAGE_NAME = "Youtube Connect - " . $consoleTitle . " - ";
$dispBreadCrumb = "<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>" . $consoleTitle . "</a> > Youtube Connect Settings";
$EXTERNAL_JAVASCRIPT .= "\n<script type='text/javascript' src='" . $MAIN_ROOT . "members/js/console.js'></script>\n<script type='text/javascript' src='" . $MAIN_ROOT . "members/js/main.js'></script>\n";
include "../../themes/" . $THEME . "/_header.php";
echo "\n<div class='breadCrumbTitle' id='breadCrumbTitle'>Youtube Connect Settings</div>\n<div class='breadCrumb' id='breadCrumb' style='padding-top: 0px; margin-top: 0px'>\n{$dispBreadCrumb}\n</div>\n";
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $ytObj = new Youtube($mysqli);
    $memberInfo = $member->get_info_filtered();
    $pluginObj->selectByName("Youtube Connect");
    $pluginInfo = $pluginObj->get_info();
    $pluginObj->pluginPage->setCategoryKeyValue($pluginInfo['plugin_id']);
    $pluginPageInfo = $pluginObj->getPluginPage("profile", $pluginInfo['plugin_id']);
    $arrProfileModules = array("User Information", "Custom Profile Options", "Games Statistics", "Squads", "Medals");
    $countErrors = 0;
    $dispError = "";
    if ($_POST['submit']) {
        // Check Display Order (before/after)
        if ($_POST['beforeafter'] != "before" && $_POST['beforeafter'] != "after") {
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid display order (before/after).<br>";
            $countErrors++;
        }
        // Check Display Order
        if (!in_array($_POST['displayorder'], array_keys($arrProfileModules))) {
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid display order.<br>";
Exemple #8
0
        break;
    case "thankyou":
        $webInfoObj->setPage("plugins/donations/include/thankyou.php");
        $hooksObj->addHook("breadcrumb", "setThankYouPageBreadcrumb");
        break;
    default:
        if (isset($_GET['custom']) && isset($_GET['payment_status'])) {
            $customVars = json_decode($_GET['custom'], true);
            header("Location: " . FULL_SITE_URL . "plugins/donations/?campaign_id=" . $customVars['campaign_id'] . "&p=thankyou");
        } else {
            $webInfoObj->setPage("plugins/donations/include/main.php");
        }
}
$campaignObj = new DonationCampaign($mysqli);
$donationPlugin = new btPlugin($mysqli);
if (!$donationPlugin->selectByName("Donations") || !$campaignObj->select($_GET['campaign_id'])) {
    echo "<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "';</script>";
    exit;
} elseif ($donationPlugin->selectByName("Donations") && $donationPlugin->getConfigInfo("email") == "") {
    echo "\n\t\t<script type='text/javascript'>\n\t\t\talert('Please complete the plugin configuration before continuing!');\n\t\t\twindow.location = '" . $MAIN_ROOT . "';\n\t\t</script>\n\t";
    exit;
}
$campaignObj->updateCurrentPeriod();
$campaignInfo = $campaignObj->get_info_filtered();
// Start Page
$PAGE_NAME = $campaignInfo['title'] . " - ";
include $prevFolder . "themes/" . $THEME . "/_header.php";
$member = new Member($mysqli);
$breadcrumbObj->setTitle($campaignInfo['title']);
$breadcrumbObj->addCrumb("Home", $MAIN_ROOT);
$breadcrumbObj->addCrumb("Donation Campaign: " . $campaignInfo['title']);
<?php

include "../../_setup.php";
include "classes/donate-paypalclass.php";
include_once "classes/campaign.php";
$donationPlugin = new btPlugin($mysqli);
$campaignObj = new DonationCampaign($mysqli);
$customVars = array();
if ($donationPlugin->selectByName("Donations") && $donationPlugin->getConfigInfo("email") != "" && $campaignObj->select($_GET['campaign_id'])) {
    $notifyURL = FULL_SITE_URL . "plugins/donations/paypal-ipn.php";
    $p = new paypal_class();
    $member = new Member($mysqli);
    $campaignInfo = $campaignObj->get_info_filtered();
    $p->setMode($donationPlugin->getConfigInfo("mode"));
    $link = $p->paypal_url . "?cmd=_donations";
    $_POST['business'] = $donationPlugin->getConfigInfo("email");
    $_POST['item_name'] = "Donation for " . $campaignInfo['title'];
    $_POST['notify_url'] = $notifyURL;
    $_POST['rm'] = 1;
    $_POST['return'] = FULL_SITE_URL . "plugins/donations/?campaign_id=" . $_GET['campaign_id'] . "&p=thankyou";
    if ($campaignInfo['currency'] != "") {
        $_POST['currency_code'] = $campaignInfo['currency'];
    }
    // Check For Custom Variables
    if (isset($_SESSION['btUsername']) && isset($_SESSION['btPassword']) && $member->select($_SESSION['btUsername']) && $member->authorizeLogin($_SESSION['btPassword'])) {
        $customVars['member_id'] = $member->get_info("member_id");
    }
    $customVars['campaign_id'] = $_GET['campaign_id'];
    $addToLink = "";
    $customVals = array("name", "message", "hideamount");
    $filterFormInputs = array("submit", "checkCSRF");