function affiliate_supporter_settings() { global $psts; if (function_exists('get_site_option')) { $getoption = 'get_site_option'; } else { $getoption = 'get_option'; } $psts_tabs = 3.5 >= $psts->version ? true : false; ?> <?php if (!$psts_tabs) { ?> <div class="postbox"> <h3 class="hndle" style="cursor:auto;"><span><?php _e('Affiliate Settings', 'affiliate'); ?> </span></h3> <?php } else { $tab = ProSites_Helper_Tabs_Settings::get_active_tab(); ProSites_Helper_Settings::settings_header($tab); } ?> <div class="inside"> <?php $prosites_currency = $psts->get_setting('currency'); $affiliate_currency = aff_get_option('affiliate-currency-paypal-masspay', 'USD'); //echo "prosites_currency[". $prosites_currency ."] affiliate_currency[". $affiliate_currency ."]<br />"; if ($prosites_currency != $affiliate_currency) { ?> <p class="error"><?php echo sprintf(__('Currency mismatch. Your Pro Sites currency is set to <strong>%s</strong> but Affiliate currency is set to <strong>%s</strong>. Please ensure both are set correctly.'), $prosites_currency, $affiliate_currency); ?> </p><?php } ?> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('1 Month payment', 'affiliate'); ?> </th> <td> <select name="supporter_1_whole_payment"> <?php $supporter_1_whole_payment = $getoption("supporter_1_whole_payment"); $counter = 0; for ($counter = 0; $counter <= 300; $counter += 1) { echo '<option value="' . $counter . '"' . ($counter == $supporter_1_whole_payment ? ' selected' : '') . '>' . $counter . '</option>' . "\n"; } ?> </select> . <select name="supporter_1_partial_payment"> <?php $supporter_1_partial_payment = $getoption("supporter_1_partial_payment"); $counter = 0; echo '<option value="00"' . ('00' == $supporter_1_partial_payment ? ' selected' : '') . '>00</option>' . "\n"; for ($counter = 1; $counter <= 99; $counter += 1) { if ($counter < 10) { $number = '0' . $counter; } else { $number = $counter; } echo '<option value="' . $number . '"' . ($number == $supporter_1_partial_payment ? ' selected' : '') . '>' . $number . '</option>' . "\n"; } ?> </select> <?php $supporter_1_payment_type = $getoption("supporter_1_payment_type", 'actual'); ?> <select name="supporter_1_payment_type"> <option value='actual' <?php selected($supporter_1_payment_type, 'actual'); ?> ><?php echo esc_html($affiliate_currency); ?> </option> <option value='percentage' <?php selected($supporter_1_payment_type, 'percentage'); ?> ><?php _e('%', 'membership'); ?> </option> </select> <br /><?php _e('Affiliate payment for one month.'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('3 Month payment', 'affiliate'); ?> </th> <td> <select name="supporter_3_whole_payment"> <?php $supporter_3_whole_payment = $getoption("supporter_3_whole_payment"); $counter = 0; for ($counter = 0; $counter <= 300; $counter += 1) { echo '<option value="' . $counter . '"' . ($counter == $supporter_3_whole_payment ? ' selected' : '') . '>' . $counter . '</option>' . "\n"; } ?> </select> . <select name="supporter_3_partial_payment"> <?php $supporter_3_partial_payment = $getoption("supporter_3_partial_payment"); $counter = 0; echo '<option value="00"' . ('00' == $supporter_3_partial_payment ? ' selected' : '') . '>00</option>' . "\n"; for ($counter = 1; $counter <= 99; $counter += 1) { if ($counter < 10) { $number = '0' . $counter; } else { $number = $counter; } echo '<option value="' . $number . '"' . ($number == $supporter_3_partial_payment ? ' selected' : '') . '>' . $number . '</option>' . "\n"; } ?> </select> <?php $supporter_3_payment_type = $getoption("supporter_3_payment_type", 'actual'); ?> <select name="supporter_3_payment_type"> <option value='actual' <?php selected($supporter_3_payment_type, 'actual'); ?> ><?php echo esc_html($affiliate_currency); ?> </option> <option value='percentage' <?php selected($supporter_3_payment_type, 'percentage'); ?> ><?php _e('%', 'membership'); ?> </option> </select> <br /><?php _e('Affiliate payment for three months.'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('12 Month payment', 'affiliate'); ?> </th> <td> <select name="supporter_12_whole_payment"> <?php $supporter_12_whole_payment = $getoption("supporter_12_whole_payment"); $counter = 0; for ($counter = 0; $counter <= 300; $counter += 1) { echo '<option value="' . $counter . '"' . ($counter == $supporter_12_whole_payment ? ' selected' : '') . '>' . $counter . '</option>' . "\n"; } ?> </select> . <select name="supporter_12_partial_payment"> <?php $supporter_12_partial_payment = $getoption("supporter_12_partial_payment"); $counter = 0; echo '<option value="00"' . ('00' == $supporter_12_partial_payment ? ' selected' : '') . '>00</option>' . "\n"; for ($counter = 1; $counter <= 99; $counter += 1) { if ($counter < 10) { $number = '0' . $counter; } else { $number = $counter; } echo '<option value="' . $number . '"' . ($number == $supporter_12_partial_payment ? ' selected' : '') . '>' . $number . '</option>' . "\n"; } ?> </select> <?php $supporter_12_payment_type = $getoption("supporter_12_payment_type", 'actual'); ?> <select name="supporter_12_payment_type"> <option value='actual' <?php selected($supporter_12_payment_type, 'actual'); ?> ><?php echo esc_html($affiliate_currency); ?> </option> <option value='percentage' <?php selected($supporter_12_payment_type, 'percentage'); ?> ><?php _e('%', 'membership'); ?> </option> </select> <?php if ($psts_tabs) { echo '<input type="hidden" name="active_tab" value="affiliate" />'; } ?> <br /><?php _e('Affiliate payment for twelve months.'); ?> </td> </tr> </table> </div> <?php if (!$psts_tabs) { ?> </div> <?php } }
/** * 'Restrict XML-RPC' * * @return string */ public static function render_tab_xmlrpc() { ProSites_Helper_Settings::settings_header(ProSites_Helper_Tabs_Settings::get_active_tab()); $module = new ProSites_Module_XMLRPC(); echo $module->settings(); }