Esempio n. 1
0
function umc_donation_chart()
{
    global $UMC_SETTING, $UMC_USER, $UMC_DONATION;
    if (!$UMC_USER) {
        $out = "Please <a href=\"{$UMC_SETTING['path']['url']}/wp-admin/profile.php\">login</a> to buy donator status!" . "<a href=\"{$UMC_SETTING['path']['url']}/wp-admin/profile.php\"><img src=\"https://www.paypalobjects.com/en_GB/HK/i/btn/btn_paynowCC_LG.gif\"></a>";
        return $out;
    } else {
        $uuid = $UMC_USER['uuid'];
        $username = $UMC_USER['username'];
    }
    $chart_data = umc_donation_java_chart();
    $outstanding = $chart_data['outstanding'];
    $chart = $chart_data['chart'];
    $donation_avg = umc_donation_calc_average();
    $table = umc_donation_top_table($outstanding);
    $active_users = umc_get_active_members();
    $out = "<div style=\"float:right; width:440px; margin-left: 30px;\">\n{$chart}\n{$table}</div>\n" . "<div style=\"width:auto; overflow:hidden; \">Uncovery Minecraft is run privately, without advertising or mandatory fees. We also want to stay away from \"pay-to-win\"\r\n        and therefore also want to only provide non-essential benefits to donators. Those benefits can be seen on the bottom of\r\n        the \"<a href=\"http://uncovery.me/user-levels/\">Userlevels &amp; Commands</a>\" page. If you ask me what I am doing with the donation money,\r\n        you have to understand that the server is already paid by me in advance on a 2 year contract since that's much cheaper than paying month-by-month.\r\n        So the donations that I receive go into my PayPal account that I use to pay other things through PayPal. I sometimes donate to other\r\n        plugin authors if I want them to speed up some features for example. The target is however that if we ever have a surplus, that\r\n        this will be used to either improve or advertise the server. The monthly server costs are 135 USD. Donations are always welcome\r\n        and encourage me to spend more time on the server and continue to fix, upgrade and enhance it, run contests and provide an adequate support to the users.\r\n        <h2>Donation Status</h2>\nWe have a target to cover our monthly costs with donations.<br>\n" . umc_donation_monthly_target() . "If the donation target is exceeded, we will use the excess to fill the gaps of the past months.<br>\n" . "On the right, you can see the long term development of the server income vs. expenses and does not include pre-payments done for the 2-year contract, but only the monthly costs as time goes by as if we were paying every month.\n</div>" . '<h2 style="clear:both;">Donate now!</h2>' . "\n<strong>Donations are processed manually.</strong> You will get an email from PayPal, but you will get a confirmation from the server only after we received an email from PayPal and manually processed it. \n" . "This can take up to 24 hours. Once you received a confirmation email from the server, your userlevel will be updated once you (re-) login to the minecraft server.\n" . '<br><br><form style="display:inline;" action="' . $UMC_DONATION['paypal_url'] . '" method="post" target="_top">' . '<input type="hidden" name="cmd" value="_s-xclick">' . '<input type="hidden" name="hosted_button_id" value="' . $UMC_DONATION['button_id'] . '">' . '<p style="text-align:center;"><input type="hidden" name="on0" value="DonatorPlus Status">' . "The average donation amount is <strong>{$donation_avg} USD</strong><br>\r\n        Buy DonatorPlus Status as user <strong>{$username}<br>\r\n            (UUID: {$uuid})" . '</strong><br> Duration <select style="font-size:12px" name="os0">
            <option value="1 Month">1 Month $2.00 USD</option>
            <option value="6 Months">6 Months $7.00 USD</option>
            <option value="1 Year">1 Year $13.00 USD</option>
            <option value="2 Years">2 Years $25.00 USD</option>
            <option value="4 Years">4 Years $50.00 USD</option>
        </select>
        <input type="hidden" name="on1" value="Your Username"><input type="hidden" name="os1" value="' . $uuid . '"><br>
        <input type="hidden" name="on2" value="for Recipient(s)">Recipient: ' . umc_web_dropdown($active_users, 'os2', $uuid) . '<input type="hidden" name="currency_code" value="USD"><br>
            <strong>Important:</strong> If you want the amount split between several users, please do not make several donations.<br>
            Make the donation for yourself and then send me a message with the details.<br>
        <input type="image" src="https://www.paypalobjects.com/en_GB/HK/i/btn/btn_paynowCC_LG.gif" name="submit" alt="PayPal — The safer, easier way to pay online.">
        <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
        </p>
        </form>';
    return $out;
}
Esempio n. 2
0
/**
 * Create a jQuery accordion
 *
 * @global array $UMC_FAQ
 * @param type $id
 * @return string
 */
function umc_faq_web($id = 'accordion')
{
    XMPP_ERROR_trace(__FUNCTION__, func_get_args());
    global $UMC_FAQ;
    $s_get = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
    if (isset($s_get['id']) && isset($UMC_FAQ[$s_get['id']])) {
        $active = $s_get['id'] - 1;
    } else {
        $active = 0;
    }
    if (isset($s_get['cat'])) {
        $presel_cat = $s_get['cat'];
    } else {
        $presel_cat = 'all';
    }
    $out = "<script>\r\n    jQuery(document).ready(function(\$) {\r\n        \$( \"#{$id}\" ).accordion({\r\n            collapsible: true, heightStyle: \"content\", active: {$active}\r\n        });\r\n    });\r\n</script>" . "<div id=\"{$id}\">\n";
    $cat_arr = array('all' => 'All');
    foreach ($UMC_FAQ as $faq_id => $F) {
        // we cannot do array_merge since we need to set the keys for the dropdown
        foreach ($F['categories'] as $cat) {
            $cat_arr[$cat] = ucwords($cat);
        }
        $cat_text = implode(", ", $F['categories']);
        if ($presel_cat == 'all' || in_array($presel_cat, $F['categories'])) {
            $out .= "    <h3 id=\"FAQ{$faq_id}\">{$faq_id}: {$F['question']}</h3>\r\n            <div>\r\n                <p class=\"answer\">{$F['answer']}</p>\r\n                <p class=\"categories\"><a href=\"?id={$faq_id}#FAQ{$faq_id}\">Direct link</a> | Categories: {$cat_text}</p>\r\n            </div>";
        }
    }
    $out .= "</div>";
    $drop = "Categories: <form style=\"display:inline;\" action=\"\" method=\"get\">\n" . umc_web_dropdown($cat_arr, 'cat', $presel_cat, true) . "</form>";
    $out = $drop . $out;
    return $out;
}