Пример #1
0
function ea_skype_page_shortcode()
{
    ob_start();
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    $tSubscriberOrContributorOrAdminOrBl = hasCurrentUserRole(array(WPUserRoles::subscriber, WPUserRoles::contributor, WPUserRoles::administrator));
    if ($tSubscriberOrContributorOrAdminOrBl == false) {
        // ..exiting if not empathizer or admin
        echo "<strong>Oops! You need to log-in first to get access to this page</strong>";
        exit;
    }
    $ob_content = ob_get_contents();
    //+++++++++++++++++++++++++++++++++++++++++
    ob_end_clean();
    return $ob_content;
}
Пример #2
0
function ea_email_form_shortcode()
{
    ob_start();
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // Check user access level.
    $tContributorBl = hasCurrentUserRole(array(WPUserRoles::contributor));
    if ($tContributorBl == false) {
        // Exit if not empathizer or admin.
        echo "<strong>Oops! This page is only for our empathizers</strong>";
        exit;
    }
    $tMaxLengthNr = floor(get_max_donation() / get_donation_multiplier());
    ?>


    <form
        id="empathizerForm"
        action=<?php 
    echo getBaseUrl() . pages::email_sent;
    ?>
        type="hidden"
        method="POST"
    >
        <label for="skype_name">Skype Name</label>
        <input name="skype_name" id="skype_name" type="text" style="display:block">
        <label for="length">Call Duration</label>
        <input name="length" id="length" type="number" pattern="\d*" min="1" max="<?php 
    echo $tMaxLengthNr;
    ?>
" style="display:block">
        <input type="submit" value="Send donation email to caller" id="submit" style="display:block">
    </form>


    <?php 
    $ob_content = ob_get_contents();
    //+++++++++++++++++++++++++++++++++++++++++
    ob_end_clean();
    return $ob_content;
}