August 26th, 2007

Another new release!. Here’s the changelist:

  • Full support for Forsyth-Edwards Notation (FEN) has been added via the FEN tag. This allows for arbitrary positioning of pieces on the board.
  • Fischer Random Chess (aka Chess960) is now supported. You must specify the opening layout via a FEN tag. The castling rules specific to this variant are handled correctly.
  • Capablanca chess is now supported. The Archbishop and Chancellor pieces have been added. Capablanca Random Chess is also supported. Caveat: arbitrary positioning of the first rank is supported, but castling always follows Capablanca Random Chess rules (i.e. the King ends up on the c or i files). This is at odds with Capablanca-derived variants such as Embassy Chess.
  • Limited support has been added for arbitrary board sizes; the plugin detects the implied board size based on the FEN tag. Note that en passant, castling, and pawn promotion makes some assumptions which change based on the board size, and not all chess variants will work correctly.
  • For persistent games, users now only require Contributor access, not Editor access, in order to play the game. Note that this will only work with WordPress 2.2; users in WordPress 2.0 and 2.1 still require Editor access due to WordPress issues.
  • Because of the potential castling ambiguity caused by the random chess variants, castling must now be done via the new buttons, rather than by direct manipulation of the King piece on the board.
  • A bug in en passant capture has been fixed.
  • The server side now correctly escapes text before posting moves to the database. Previously there were SQL issues preventing some posts from being updated correctly.
  • Various cross-browser/platform user interface glitches have been fixed.
  • The default icons are now 32×32 instead of 44×44.

As usual, here is the Chess By Blog blurb page.

And here’s the download - ChessByBlog-1.0.2.zip, 212 KiB.

Please post any questions or issues in the comments. Happy chess playing!

20 Responses to “Chess By Blog 1.0.2”

  1. BGH Quiz Says:

    You closed the old entry, so I’ll reply to you here this time. You asked whether I’m looking for a chess board which allows *any* person with “Subscriber” access the ability to post a move. And yes, that is what I’m looking for. I’d like all of the readers that are registered to play against one person, and that would be the admin of the blog. I think it would be fun if every registered reader had the chance to participate in the game as soon as the admin moved.

  2. levork Says:

    I think this almost works as it stands now. If you’re willing to try the plugin and edit some of the PHP, you should be able to do this by editing one line of code in chess-by-blog.php. At line 155, where it currently reads:

        if (current_user_can('edit_posts') && ($classUnMunged || current_user_can('unfiltered_html'\))) {
    

    change this to

        if (current_user_can('read') && ($classUnMunged || current_user_can('unfiltered_html'\))) {
    

    This assumes the WordPress documentation about Roles is correct. Once you do this, as long as one of the sides has a user id of “*” - i.e. CBB-WhiteID “*” vs CBB-BlackID “bgh” - anyone who’s a suscriber can make a move when it’s white’s turn and it’ll post to the database. Black will be restricted to user “bgh”.

  3. levork Says:

    BTW, the above assumes you’re running WordPress 2.2. It won’t work in previous releases due to WordPress bugs.

  4. BGH Quiz Says:

    Thank you, I’ll try this throughout the upcoming days and let you know. I’m running WP 2.2, so I hope it will work.

  5. Jan Says:

    Hi levork,

    I´d like to use your chess-by-blog in me newly installed blog using WP 2.3.2

    I tried to build up a closed game for test purposes between to UserIds but it didn´t work. The moves weren´t updated to the post and the second UserId couldn´t play and did not see the move made by the first UserId on the board….

    Perhaps I failed, because I tried it using ONE internet-session with TWO browser windows (one for each UserId) using the same IP??
    The UserIds are “admins”. There is no other test-scenario for me at the moment using different IPs, sorry.

    But I´m assuming that the game was not persistant at all, when I left the blog logging out & coming back again (logging in again, surely) there was no move played before.

    Thank you for your help….

  6. levork Says:

    Hi Jan,

    Using one IP address is fine as long as you log out of Wordpress in between sessions, or close your browser. But it sounds like the move didn’t even get posted to the blog in the first place. When the first user sees the board, does it say “game, awaiting your move (post will update)”? And after the first user posts a move, do you see text stating “Posting move to blog”, followed by “Closed for opponent’s move”? Is there any dialog box that shows up in between?

  7. Jan Says:

    Hi levork,

    nice to see you!

    Answering your questions: Yes, first user gets message …. updating… and message posting move to blog is displayed also, even closed for…. I did not see any dialog boxes in between these messages.

    But even if these are (good) messages for UserId1 related to “parse his move by your plugin” UserId2 can´t catch the move played by UserId1. Even UserId1 doesn´t see his move again while logging in AGAIN…

    Sounds weird…
    but it´s true…

  8. DylanDog Says:

    Hi levork,

    I run wordpress 2.3.2 on my server.

    I think I have a similar issue as Jan has and I think it is (also?) related to the web browser.

    I am also using your tool in my chess blog and have found out the following issue on public games: If you play with I.E 6.0, the board is intantly updated but if you do a refresh the move(s) done desappear, with FireFox 2.0.0.11 it works fine instead.

    You can try here: http://www.chessblog.eu/?cat=6 on the post called Piblic Opened Game

  9. DylanDog Says:

    Hi levrok,

    I also have the same problem on the closed games. I can do the first move, which is then saved. I have clicked on few other webpages of my blog and when I come back to the game page everything is fine. Then I have closed the browser then reopened it and I logged in with the second account, I have done the second move with no problem. Then I have clicked on another page of my blog and when I came back to the game page the board is not showed anymore but only the text. Browser was FF 2.0.0.11.

    [Event ""]
    [Site "www.ChessBlog.eu, NET"]
    [Date "2008.01.03"]
    [Round ""]
    [White ""]
    [Black ""]
    [CBBWhiteId "admin"]
    [CBBBlackId "testplayer1"]
    [Result "*"]

    1.e4 e5

  10. levork Says:

    Hi DylanDog,

    For the public, open game: if you refresh the browser, the board should clear back to the game as saved in the post, i.e. any interactive moves you make will not be saved. That’s by design. It’s odd that you’re noticing Firefox preserves the moves through a refresh, I’m not seeing that here.

    For the closed game: I’m working with Jan on trying to diagnose the problem on his site - I suspect there might be something wrong with the postmove.php script. But I think his problem is different than yours. I looked at your site and the closed game has lost some information in the div tags - which shouldn’t be happening. You didn’t happen to edit that post in WordPress by accident, did you? If you edit a post after a game has begin WordPress may strip extra information from div tags, which breaks the chess plugin. Unfortunately this behaviour is hard to disable in the plugin.

  11. DylanDog Says:

    1-For the public, open game: i confirm that after the refresh the previously made interctive moves are there, i.e. the post has been updated with them, I will do a video with my mobile phone as soon as I can and will post it on my blog to show you.

    2-For the closed game: I am aware of the “bug” that clear the div tags when opening the post, no I did not edit it.

    3-I am still convinced there is something wrong with I.E. 6 and your script.

  12. levork Says:

    DylanDog -

    I just confirmed that Internet Explorer is indeed doing something very weird to the closed game. I will investigate tonight and try to turn around a new version in the next few days. Sorry for the trouble.

  13. DylanDog Says:

    Sorry for the trouble? you do not have to apologies, your tool will be working fine soon or later i am sure and I am happy to help because I find this plugin really useful!

    I have attached a simple video which shows that 2 x refresh with FF 2.0 and 1 refresh with I.E.6, with FF the previous moves are saved in the post with IE not.

    http://www.chessblog.eu/?p=51
    http://www.chessblog.eu/wp-content/uploads/2008/01/sv_a0258.mp4

    sorry for the bad quality of the video ;-)

    DylanDog

  14. levork Says:

    DylanDog:

    I found a problem that wasn’t actually due to Internet Explorer, it was due to WordPress and how it manages user capabilities. Basically, if a user didn’t have a high enough role (editor or admin), their edits to the post (a chess move counts as an edit) were being filtered by WordPress. I was aware of this problem but I thought I’d worked around it. Turns out I was wrong!

    I’ve tried another work around. Can you try using this version of postmove.php? It goes in wp-content/plugins/chess-by-blog, replacing the one that’s there.

    http://www.levork.org/cbbzips/1.0.2fix/postmove.php.zip

    Jan, I don’t think this solves your problem, but it wouldn’t hurt to try this one.

  15. DylanDog Says:

    levork,

    I have tested the new version of postmove.php

    Both FF and IE produce the following results:

    1- Public Open Games: if the user is not logged or logged as “subscriber” the post is not updated, if the logged user is at least a “contributor” then the post will be updated.

    2- Persistent Games: it works fine now, only users with at least “contributor” level are able to play, the board is then updated. I see no bugs anymore with I.E.

  16. levork Says:

    Excellent!

    The contributor access is a feature, since there’s a check for whether the user has the ability to edit posts, not just read them, before the post can be updated. Did you want to change this behaviour? i.e Are you trying to set up a situation which is the same as comment #1 in this post - the admin plays a game, and then anyone who is a reader (or anyone who is a subscriber) can move the other side? If so, this can be done by editing chess-by-blog.php - I’m not sure my changes in comment #2 are sufficient, but if not I think I know what will do the trick (in particular, now that I’ve fixed postmove.php, the check on the unfiltered_html capability is no longer needed). I can see about making this a more easily configurable option in the next release.

  17. DylanDog Says:

    I think that giving all subscribers (not readers!) the ability to play a game can be useful in some case, I will have a look at the chess-by-blog.php and at comment #2 and will let you know (I can play a bit with php but not a lot!)
    DylanDog

  18. levork Says:

    DylanDog - I’ll make it the default in the next release that subscribers will be able to play as long as their name shows up in the tag.

    To others - with Jan’s help I seem to have resolved most of the session problems which may result from a PHP setup which doesn’t enable output buffering. There are also some draw and castling problems that have been fixed. I’m near to making a 1.0.3 release, if there are any other bugs that you’re aware of, let me know soon!

  19. Jan Says:

    levork,

    found no new bugs yet in some tests, draw problem already discussed :-). Thank you for the very good support! Auto-refreshing the board would be a very convenient feature…

    http://www.schach-blog.de/demo2-fur-online-schach-closed-game/

    DylanDog´s idea sounds good to me too, it´s worth to be implemented in my opinion.

  20. levork Says:

    I just made a 1.0.3 release of the plugin which fixes various bugs.

    http://www.levork.org/2008/01/07/chess-by-blog-103/

    I’m closing comments in this post - any issues, please report in the new post. Thanks!

© 1999-2008 Julian Fong