コード例 #1
0
 /**
  * Test the geo lookup function.
  *
  * @since  4.6.1.1
  */
 public function ajax_test_geo()
 {
     $type = @$_POST['type'];
     $ip = $this->get_users_ip();
     $service = $this->get_service($type);
     if ('db' == $service->url) {
         IncPopupAddon_GeoDB::init();
         $country = apply_filters('popup-get-country', $country, $ip);
     } else {
         $country = $this->country_from_api($ip, $service);
     }
     echo 'IP: ' . $ip . "\nService: " . $service->label . "\nCountry: " . $country;
     die;
 }
コード例 #2
0
ファイル: class-popup-base.php プロジェクト: ultr0/TM-FreeTV
 /**
  * Loads the active Add-On files.
  *
  * @since  4.6
  */
 public static function load_optional_files()
 {
     $settings = IncPopupDatabase::get_settings();
     if ($settings['geo_db']) {
         IncPopupAddon_GeoDB::init();
     }
     // $available uses apply_filter to customize the results.
     $available = self::get_rules();
     foreach ($available as $rule) {
         $path = PO_INC_DIR . 'rules/' . $rule;
         if (in_array($rule, $settings['rules']) && file_exists($path)) {
             include_once $path;
         }
     }
 }
コード例 #3
0
/**
 * Display the popup settings page.
 */
$loading_methods = IncPopupDatabase::get_loading_methods();
$settings = IncPopupDatabase::get_settings();
$cur_method = $settings['loadingmethod'];
$form_url = esc_url_raw(remove_query_arg(array('message', 'action', '_wpnonce')));
// Theme compatibility.
$theme_compat = IncPopupAddon_HeaderFooter::check();
$theme_class = $theme_compat->okay ? 'msg-ok' : 'msg-err';
// START: Geo Lookup
$geo_service = IncPopupDatabase::get_geo_services();
$no_ip_cache = false;
$custom_geo = false;
$geo_msg = '';
if (!IncPopupAddon_GeoDB::table_exists()) {
    $no_ip_cache = true;
    $settings['geo_db'] = false;
    $geo_msg .= '<p class="locked-msg">' . sprintf(__('<strong>Local IP Lookup Table</strong>: This is unavailable because ' . 'no geo-data table was found in your database. For details, ' . 'read the "Using a Local Geo-Database" in the ' . '<a href="%1$s" target="_blank">PopUp usage guide</a>.', PO_LANG), 'http://premium.wpmudev.org/project/the-pop-over-plugin/#usage') . '</p>';
}
if (defined('PO_REMOTE_IP_URL') && strlen(PO_REMOTE_IP_URL) > 5) {
    $custom_geo = true;
    $settings['geo_lookup'] = '';
    $geo_msg .= '<p class="locked-msg">' . __('<strong>Custom Webservice</strong>: You have configured a custom ' . 'lookup service in <tt>wp-config.php</tt> via the constant ' . '"<tt>PO_REMOTE_IP_URL</tt>". To use one of the default services ' . 'you have to remove that constant from wp-config.php.', PO_LANG) . '</p>';
}
// ----- END: Geo Lookup
$rules = IncPopup::get_rules();
$rule_headers = array('name' => 'Name', 'desc' => 'Description', 'rules' => 'Rules', 'limit' => 'Limit');
$ordered_rules = array();
?>
<div class="wrap nosubsub">