Create a WordPress MochiAds Leaderboards Widget

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

  • What about the plugin to add games to wordpress when you gonna release?

  • dix huit

    +1 – When’s the WordPress Arcade plugin gonna see the light of day?

  • Emanuele Feronato

    As soon as it’s bug free…

  • Nathan

    Oh my gosh…. stop bugging him about the WP Arcade! He will tell you when its ready!

  • 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.

  • Please don’t use the “” URL, that was a mistake on our part.

    We’ve just released significant updates to the leaderboard widgets, check it out:

  • Bob

    Dear Emanuele,
    Please publish that plugin for importing games.

  • 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…

  • Pingback: Flash Game Development Inter-web mash up: October 17, 2008 «