'Error', 'Error' => curl_error($curl)); else if (empty($response)) $obj = (object) array('Result' => 'Error', 'Error' => 'Connection failed'); else $obj = json_decode($response); curl_close($curl); return $obj; } function PMAPIisCurl() { return function_exists('curl_version'); } */ function PMAPI_Poker_API($params) { $params['Password'] = get_option('pmapi_api_password'); $params['JSON'] = 'Yes'; $url = get_option('pmapi_server_url') . "/" . get_option('pmapi_api_dir'); $args = array( 'method' => 'POST', 'timeout' => 30, 'redirection' => 2, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array(), 'body' => $params, 'cookies' => array(), 'sslverify' => false); $response = wp_remote_post( $url, $args ); if ( is_wp_error( $response ) ) $obj = (object) array('Result' => 'Error', 'Error' => $response->get_error_message()); else if (empty($response)) $obj = (object) array('Result' => 'Error', 'Error' => 'Connection failed'); else $obj = json_decode(wp_remote_retrieve_body($response)); return $obj; } function pmapi_plugin_settings() { register_setting( 'pmapi-plugin-settings-group', 'pmapi_server_url' ); register_setting( 'pmapi-plugin-settings-group', 'pmapi_api_dir' ); register_setting( 'pmapi-plugin-settings-group', 'pmapi_api_password' ); register_setting( 'pmapi-plugin-settings-group', 'pmapi_site_password' ); register_setting( 'pmapi-plugin-settings-group', 'pmapi_version' ); register_setting( 'pmapi-plugin-settings-group', 'pmapi_avatar_max' ); } function pmapi_plugin_settings_page() { ?>

API for Poker Mavens Settings:

Poker Mavens Server:
 
 
(ex. http://poker.servername.com:8087)
API Directory:
 
 
(the default is "api" in the Poker Maven's server.)
API Password:
 
 
(Keep this secret and safe.)
Site Password:
 
 
(This is not necessary, if you enter it links from your site to the server won't ask for it.)
PM Version:
 
 
(Used for avatar image size.)
Max Avatars:
 
 
(total avatars 1-64)

This adds the Poker Mavens API features from several of the examples given on the poker mavens support website. This is minimal and will link up a wordpress username with a username on the Poker Mavens Server.

BE AWARE: if the name already exists on the Poker Server, this plugin in it's form does not verify the password to log in. If you can log in to the Wordpress site, and use this API the same username will be linked to it, and it will not verify that the wordpress user actually own's that account. (Contact me if you would like customizations done, I will be happy to discuss a custom plugin for your site.) If the username does not already exist on the server this plugin will offer to create a new account using the same username.

This plugin shows that it is realitivly easy to set up a website to support your Server using Wordpress making it easy to build an astetically pleasing site with verly little programming skill.

Shortcodes: [pmapi_server_stats] [pmapi_server_top10] [pmapi_userinfo] [pmapi_rawdata] [pmapi_login]

Settings', 'Author Site'); $links = array_merge($mylinks, $links); return $links; } add_filter( 'plugin_action_links_' . PMAPI_BASE, 'pmapi_add_action_links'); add_action('admin_menu', 'pmapi_plugin_menu'); add_action('admin_init', 'pmapi_plugin_settings'); ?>