Wordpress Plugins – Extensions

Just another WordPress.com weblog

EidoGo for WordPress 0.8.9

Author: Thomas Schumm
EidoGo for WordPress makes it easy to embed SGF files in your
WordPress-powered blog with the EidoGo SGF viewer and
editor. If you write a blog about go (baduk, wéiqí, 碁,
etc.) this plugin will let you easily post go diagrams, game records,
problems, joseki dictionaries, etc. PHP 5 is required. Imagemagick is
recommended but not required

Unzip the archive into your /wp-content/plugins/ directory
Activate the plugin through the ‘Plugins’ menu in WordPress

That’s it! No additional hooks or configuration is required. You can start
embedding SGF files immediately.

The included stylesheet should provide a reasonable layout for your EidoGo
instances. However, you may want to add some styles to your theme to tweak the
layout. See the FAQ section for details.

So, how do I embed an SGF File?

EidoGo for WordPress integrates with the WordPress media library thingy, so
you can embed an SGF file exactly the same way as you would an image – the
plugin will insert the necessary tags for you automatically.

You can also embed an SGF file manually, for instance:

[sgf sgfUrl=”/wp-content/uploads/2009/11/example.sgf”][/sgf]

By default EidoGo will be inserted with the “compact” theme. If your blog
has a wide enough layout, you can use the “full” theme which adds nice
things like a variation tree, larger comment box, etc.

[sgf theme=”full” sgfUrl=”/wp-content/uploads/2009/11/example.sgf”][/sgf]

You can also specify the “compact” theme explicitly. By default, EidoGo
instances will be embedded in an iframe to allow keyboard shortcuts to be used
to navigate the game without stealing them from the user’s browser. If you don’t
want to use iframes for some reason, you can specify themes of “compact-inline”
or “full-inline” to embed the EidoGo instance directly. Keyboard shortcuts
will be disabled, however.

Because SGF is a text based format you can also embed the SGF data directly in
your post without uploading it as a separate file. Just open the SGF file in
something like notepad, then copy and paste the SGF data between [sgf][/sgf]
tags in a post, page or comment.

For example, this will embed a blank 19×19 board:


How do I add a problem?

Specify [sgf theme=”problem”] to activate EidoGo’s problem mode. In problem
mode iframes are not necessary, nor are used. For maximum usefullness I
recommend putting comments at the end of each branch indicating if the branch
is correct or incorrect, otherwise EidoGo gives no indication.

It’s possible that EidoGo won’t correctly determine which color should be
automatically played (it tries to look for a PL[] entry in the SGF file),
but you can override it by specifing, e.g. [sgf problemColor=”B”]

Can I embed as a static diagram image?

Yep, add the parameter image=”true”. This is also what gets inserted in RSS
feeds since EidoGo obviously won’t work there. Note: imagemagick needs to be
installed on the server and in the path for this to work. If the plugin can’t
find imagemagick, it will insert static text instead.

What other parameters are there?

You can specify a caption for the EidoGo instance with caption=”Caption”.
You can link the caption to some url with href=”http://www.example.com/” if
you, for example, want to link to some discussion of the game.

You can specify the loadPath parameter for EidoGo with loadPath=”something”
if you understand how to use that. As a shortcut for jumping to a move number
in the main branch, you can specify moveNumber=”72″ or some such.

You can specify class=”className” if you want to add a CSS class to the
containing element (useful if you want to, for example, align a problem to the
left of the screen instead of the right or something).

Can I see an example in action?


I want to tweak the layout within my theme; what’s the markup look like?

It’s pretty simple:

<div class=”wp-eidogo wp-eidogo-[theme]”>
<div id=”player-container-[id]” class=”player-container”>
…iframe or EidoGo instance…
<script type=”text/javascript”><!–
…some javascript to invoke EidoGo…
<p class=”wp-caption-text”>[caption]</p>

The included styles will align EidoGo instances with the alignleft,
aligncenter and alignright classes the same as one would expect for
images, but you may want to add a few lines to your theme’s stylesheet to
match things like margins with the rest of your layout or to change how
instances are laid out by default when no alignment has been specified.

I want to customize the appearance of EidoGo and need to load a stylesheet from within the iframe — can I do that?

Yes. The plugin will check for the existence of a file called “wp-eidogo.css”
within your theme’s directory and will load it as necessary.

What other stuff can you do?

Try adding the random problem widget to your sidebar. It’ll pull a random
problem from any of the uploaded SGF problem files. Note: it only chooses from
those in your media library (attachements). It won’t include those embedded

There’s also a widget that lets you browse problems by category or difficulty,
and one to browse games by category. For this to work nicely, you’ll want to
make sure your theme does a good job of handling WordPress’s custom taxonomies
(which is what the plugin uses to categorize problems) and can invoke eidogo
to display SGF attachments. Check out the eidogo-for-wordpress/examples
directory, and also the next FAQ question.

Can I make SGF files show up nicely on the attachment page?

Yep, a convenience function is included; you’ll just have to edit your theme’s
attachment.php. Right now, the main part of it probably looks something like:

<?php if ( wp_attachment_is_image($post->id) ) … ?>

<?php else : ?>

<?php endif; ?>

You’ll want to add some code to treat SGF files in a special way.

<?php if ( wp_attachment_is_image($post->id) ) … ?>

<?php elseif ($post->post_mime_type == ‘application/x-go-sgf’) :
echo wpeidogo_embed_attachment($post);
<?php else : ?>

<?php endif; ?>

By default, wpeidogo_embed_attachment() will use the same options as are
saved with the SGF file in your media library, but it also takes parameters…

wpeidogo_embed_attachment($post, $class, $caption, $href, $theme, $method)

All except the first (the attachment iself) are optional. So if you want to
center the SGF file, pass ‘aligncenter’ for $class. By default, $class
is null, $href is a direct link to download the SGF file (the other
parameters use the saved values.)

Take a look in the eidogo-for-wordpress/examples/ directory to see some
files from my theme that handle this.

How did you get the really compact layout with tiny stones in that screenshot of the random problem widget?

As of version 0.8.7 of the plugin, this should be handled automatically.

I’m getting an error message in Internet Explorer 6 (or older) telling me to upgrade.

Yeah, the plugin doesn’t work with IE 6 or older. EidoGo can be made to work
with IE 6, but it’s not something I’m going to waste my time on. If you
really need IE 6 support, I can e-mail you more details on the exact nature of
the problem and will accept patches, but you should really just upgrade to a
real web browser.

I intend to support current or reasonably recent versions of Firefox, Google
Chrome, Opera, Safari and Internet Explorer (which means pretty much any Gecko
or KHTML browsers are probably covered). I’ve tested the plugin with various
recent versions of Firefox, Chrome, IE 7 and IE 8 so far.

I’m getting an error message and I have PHP 4

Right now, PHP 5 is required and I don’t have a PHP 4 setup to test with.
Sorry. If you feel like writing a patch, I’ll take a look.

I’m having some other problem

Oh, maybe I screwed up. Send me an e-mail.

EidoGo for WordPress 0.8.9


April 25, 2010 - Posted by | download, extension, extensions, free, get, internet, plugin, plugins, Uncategorized, wordpress

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: