The Mochi Arcade Auto Post Plugin was built out of necessity, it seemed to me that the plugins on the market were either designed to transform your blog entirely into an arcade, or to spam your blog with thousands of (mostly terrible) games. Neither of these fit my needs, I just wanted a plugin that would download game details when I clicked on the “post game to your site” button at mochi, and then create a post with the game in it. Such a simple requirement, but to my dismay I found nothing. I, however, am well versed in web programming languages (though not so much on design), and knew I could create a plugin to fit my needs. Somehow I doubt I’ll be the only one facing this dilemma, so I’m also releasing this plugin to the public!
Current versions of wordpress don’t work with this plugin. I’m no longer interested in updating it! I may return to it, but probably not anytime soon.
Setup is simple,
There’s a link that will bring you to the Mochi game’s publisher settings, on the plugin settings page located under settings->Mochi Arcade Auto Post. You’ll have to sign up for a publisher account with Mochi if you haven’t already. If you’re also a Mochi developer you can just activate publisher features on your developer account. In the Mochi publisher settings page you’ll find “publisher id” simply copy, and paste your publisher id into the text box next to the link on the plugin page, and select how you want your game posts to appear (as the game, or as a link to the game).
You’ll also need to point Mochi to the plugin on your website, the address will be http://www.example.com/wp-content/plugins/mochi-arcade-auto-post/mochiArcadeAutoPost.php
If your wordpress installation is in a subdirectory (http://www.example.com/wordpress) remember to add that subdirectory appropriately eg. http://www.example.com/wordpress/wp-content/plugins/mochi-arcade-auto-post/mochiArcadeAutoPost.php
You’ll find this at the bottom of your Mochi publisher settings page (linked to in the plugin settings)
And that’s it, that’s all you have to do to setup the plugin.
You can now click the “Post game to my site” button on Mochi’s game pages, and it’ll add those games to your queue.
To access your queue, go to the dashboard->posts->Mochi games queue
This will show you a little about each game you clicked, and give you options for what to do with them (post, delete, edit, etc). If you click post and publish, the game will be inserted into a wordpress post with appropriate categories and tags, and immediately publish that post. If you click post, the generated post will be set aside for your review.
A quick way to reach a game’s post is to click the “posted” button (listing all games that have been posted), and click “edit”, this will bring you to that game’s post, with the editor open. You can also reach it the normal way through wordpress.
You’ll notice that the posts only contain a shortcode, and the description, this shortcode only produces the embed code for the swf if the page is viewed directly (ie: you won’t have 5 swfs running on your home page) If you wish to customize it, or include games in other posts, you can use the shortcode to do so. There are a few options you can set. I noticed that the games can sometimes be wider than your wordpress theme, blocking some buttons, so I added functionality to control the game’s dimensions. Some games respond well to this, some don’t. I also added an option to output the game’s description, as well as instructions. All of those options are below.
the shortcode is [[mochigame]], which requires a game_tag, so [[mochigame game_tag=example]]
It will work even if the game hasn’t been posted, HOWEVER, you will not be paid for that game’s plays because the game’s files are not downloaded to your site until you click one of the two post buttons. (the game MUST be in the queue, however). The actual post that is made by this plugin is what links the game tag to individual swf files, so if the post is deleted through the wordpress posts page, using the shortcode for that game will produce an error. This is likely to change in later versions. If you delete a post accidentally, you can just click repost (this will always produce an unpublished post)
- width If set will resize the swf’s width, if height is not set, it will also set the height, keeping the aspect ratio the same (default: 0 (game default))
- height Same as width, but swap width and height (default: 0 (game default))
- overridewidth Accepts true or false, prevents the plugin from modifying the game’s default size (but does not disable flashscreen)
- flashscreen (see flashscreen section)
- instructions Determines whether to display instructions, can be set to true or false (default:false)
- description Determines whether to output a description, can be set to true or false (default: false
- author Tells the plugin to display the author’s name, can be set to true or false (default: true)
- authorlink Tells the plugin to turn the author’s name into a link to his profile, can be set to true or false (default: true)
If both description and instructions are set to true, the description will always appear above the instructions, and if you set neither width nor height the game’s original dimensions are kept. The description and instructions are included in the post already if you’re posting the game via the post button in the admin screen, which is why it defaults to false.
Since the 1.1.0 update, the shortcode also posts screenshots and thumbnails based on plugin settings. Any post with the excerpt m-DONT CHANGE:<game tag here> will also process the shortcode in that game’s post (not the post the excerpt came from), including the text enclosed in the shortcode as the post excerpt. Basically making the plugin’s games look better on archive pages that use the excerpt. There will be a fallback in the future should that game not have a valid post to pull from, or the game tag not be valid, for right now that behavior remains undefined. (expect strange, possibly error prone results if the game_tag doesn’t link to a valid, posted game)
- flashscreen=false – Removes the flashscreen option, wmode=direct
- flashscreen=stage3d – Removes the flashscreen option, wmode=direct (really an alias for false)
- flashscreen=deform – Will deform the flash movie to fit the screen size exactly, wmode=transparent
- flashscreen=keep – Will keep the aspect ratio of the flash movie, wmode=transparent
- flashscreen=stagescreen – WARNING: This setting is experimental, use at your own peril. Will keep the aspect ratio of the flash movie, wmode=direct
A note about game data
The data that is included with every game (description, instructions, image locations, etc.) is set by the developers of each individual game, as such some do not include all four images, and some have horrific mis-spellings and grammar issues in the descriptions. It is for this reason that I recommend using the post button, rather than the post/publish button, and reviewing the description to ensure that it meets your standards.
Another note, but about altering the size of the flash files
This plugin allows you (and your users) to alter the size at which flash objects are embeded into the browser, while some games deal with this flawlessly, others not so much, there are methods available for you to prevent this on a per-game basis, mostly using the shortcode. overridewidth=true will cause the game to be embeded at its default size regardless of other settings. And using flashscreen=false or flashscreen=stage3d will turn off the button users have to expand the flash to fill their screen. These also cause the game to embed with wmode=direct instead of transparent, since it isn’t necessary for html elements to be layered over them, and there is a performance gain by doing so.