WordPress Integration

Download WordPress Plugin

Installation

Here’s how to integrate your WordPress site with Cubeia Social:

  • PHP version 5.3+ required
  • You must enable friendly URL’s. To do this go to Settings -> Permalinks and select any setting that includes “name”. “Default” setting will not work.
  • Changes in your operator pages (e.g. integration URL) can take up to 10 minutes to propagate through out the system.
  1. Download the Cubeia Social WordPress plugin.
  2. Install the Cubeia Social WordPress plugin, either by uploading it through the plugin installer or manually with FTP. Help on installing plugins.
  3. Go to your operator page here at Cubeia Social and note down the “operator ID” and “API Key” which you will need for configuration.
  4. Also on the operator page, enter your integration URL, which is usually your domain name followed by “/cubeia-social/”, eg: http://www.mypoker.com/cubeia-social/. NOTE: You must include the ‘http://’ part!
  5. Now enable the Cubeia Social plugin, and go to Settings -> Cubeia Social, and enter the operator ID and API Key from above, then click “save”

Adding Links to the Poker Client

You can add links to the poker client using one of these two WordPress shortcodes:

[cs_poker_client_url] - This will render a full URL to the poker client.

Example creating a link that will open the Poker client:

<a href="[cs_poker_client_url]">Play Poker</a>

You can also supply a table id/tournament id to this short code to link directly to a table/tournament

[cs_poker_client_url table="{tableId}"]
[cs_poker_client_url tournament="{tournamentId}"]
Displaying Tournaments

From version 0.2 of the plug-in you can display tournaments in “announced” or “registering” state on your website with a simple shortcode:

[cs_tournament_table] - Renders an HTML table with tournament information.

The above tournament table can be styled using CSS to fit your site.

Displaying Leaderboards

From version 0.3 of the plug-in you can display leaderboards with a simple shortcode:

[cs_leaderboard]  - Displays the top_balance leaderboard with 10 entries of your players

the cs_leaderboard shortcode takes 3 settings:

  • leaderboard_id – the leaderboard you want to display
  • max_display_items – the maximum number of entries you want to display
  • global_leaderboard – if you want to display a global leaderboard (true) or just your players (default = false):
[cs_leaderboard leaderboard_id="cashgame_net_winnings"  max_display_items="10" global_leaderboard="false"]

 

Deep linking

You can link directly to a table or a tournament lobby:

http://{yourdomain}/cubeia-social/table/{tableId}
http://{yourdomain}/cubeia-social/tournament/{tournamentId}

If the user is authenticated on your wordpress site he will be redirected to the poker client with a valid authentication token.
If he is logged out he will be redirected to the default wordpress login page

Read more here.

Configuration

The rest of the configuration options for the plugin are:

  • “Auth Cookie TTL” – This determines how long a “poker session” lasts in hours, determined from the first login of the user. This is separate from the WP session since Cubeia Social cannot rely on the WP cookies to determine if a user is valid or not. 
  • “Base URL” – This is the root of the integration on your site. Do not change this unless it clashes with something else. And if you do change, please make sure to change on your operator page as well. This corresponds to #4 above.
  • “Enable Logging” – If set to “true” the plugin will log to a dedicated file.
  • “Log Directory” – Where to log to, defaults to the plugin directory and must be writable for the logging to work.
  • “Log Level” – Level of log details, if enabled.
  • API Key – Your operators API-key used when communicating with the cubeia API’s

 

Configuration Notes

The Integration URL specified in www.cubeiasocial.com needs to be the fully qualified URL. The Base URL specified in your WordPress plugin settings is relative. Example:

  • Integration URL (www.cubeiasocial.com): http://www.mysite.com/cubeia-social/
  • Base URL (www.mysite.com plugin settings): cubeia-social/
Release Notes
Version 0.18
  • Added email to authentication response to support client player invites
  • Changed default client URL
Version 0.9 – 0.17
  • Added shortcodes [cs_online_players max_display_items=”10″ tables=”false”] and [cs_online_count] to display online players and count.
  • Added shortcode [cs_achievements] that will display the achievement list for the logged in player.
  • Fixed turnament date format
  • Extracted integration domain & client skin to config
  • added default value to get log level
  • improved error handling
  • Touching cookie on URL generation
  • added auto updating leaderboards
  • Added short code [cs_tournament_winnings currency=”XCC”]
Version 0.8 – 4 June 2013
  • Added deep linking to tables and tournaments to the play url short code [cs_poker_client_url table=”234″] or [cs_poker_client_url tournament=”234″]
  • Added deep linking redirect page. Going to /cubeia-social/table/123 will redirect an authenticated user to the poker client and open the provided
    table. The user will be sent to wp authentication page if not logged in
Version 0.7
  • Added error handling when fetching leaderboard.
  • Fixed parsing of avatar urls.
Version 0.6
  • Added avatar url to login response
Version 0.5
  • Fixed leaderboard amounts to handle decimal strings instead of integer cents
Version 0.4
  • Fixed cs-tournaments.js to set contentType to application/json
Version 0.3
  • Added [cs_leaderboard leaderboard_id=”top_balance” max_display_items=”10″ global_leaderboard=”false”] for displaying leaderboards
Version 0.2 – 18 April 2013
  • Adding [cs_tournamnent_table] to short codes.
Version 0.1
  • First release.