Create a WordPress MochiAds Leaderboards Widget

Emanuele Feronato Flash, Php, WordPress

Some time ago I blogged about Showing MochiAds leaderboards in any Flash movie or web page with a script made by myself that displayed MochiAds leaderboards on your site.

Yesterday MochiAds guys released a widget that accepts a game slug and partner ID and will display all the available leaderboards for the given game. The partner ID will constrain the widget to showing only scores from your site if you choose to do so. The widget is a Flash .SWF that can be embedded on any HTML page on your site.

In the official docs page there is an example using swfobject library but there is a much simpler way to embed scores… here it is:

Just replace ballbalance with the game slug you want to display highscores.

Width and height have minimum values of 230 and 200 pixels, and the score table will adjust according to size.

Here it is an example of a leaderboard with 400×400

And this is the tiniest one…

… that looks perfect to be embedded in a blog

Let’s create the WP widget!

Before continuing, I suggest you to read How to create a WordPress Widget if you don’t have experience with WP widgets.

The new widget is made this way (don’t worry, I’ll explain how to do it during one of next tutorials)

and creates customizable widget allowing you to specify name and slug of your game this way:

Download the widget and give me feedback

Want to learn more? Learn by example!

Get the full commented source code of an actual commercial cross platform HTML5 game!!

Comments 9

  1. Post
    Author
  2. dix huit

    @Nathan: I’m not bugging him, just checking in. The man said it would be ready on October 1st. I’m just really looking forward to this plugin.

    I’d give him a hand if my PHP was better.

  3. cam mozaik

    Thanks a lot! I am just learning Information.
    And php and this was very easy to follow and helped a lot.
    You really took time to explain every little bit.
    Thanks again…

  4. Pingback: Flash Game Development Inter-web mash up: October 17, 2008 « 8bitrocket.com

Leave a Reply

Your email address will not be published. Required fields are marked *