Bookmark and Share

The New DHTML Chess

January, 12th, 2017, The work on the chess software found on this page has been discontinued and replaced with the new DHTML Chess 3 found on dhtmlchess.com. The new DHTML Chess has been build from scratch. It can be downloaded from dhtml-chess.com/download.php

The New DHTML Chess software is also Mobile friendly.

Here are some demos:

DHTML Chess 3 - Tactic Trainer.
DHTML Chess 3 - Play Against Javascript Chess Engine.
DHTML Chess 3 - Example of Tactics Trainer embedded on a Web Page.
DHTML Chess 3 - Full Screen View PGN Viewer.

Security bugfix, August 28th, 2013

dhtml-chess.zip has today been updated with a security bugfix for the PGN Parser. The fix validates PGN file path before parsing it. We recommend that you update PgnParser.php with the latest version in the zip file.


These demos illustrates different ways to configure the DHTML Chess script.

Game viewers/Relay of live games:

Tactic training/Opening training


This script is distributed under the LGPL open source license.
Commercial licenses are also available. Some of these licenses also includes personal e-mail support for up to 1 year.

The LGPL license does NOT apply to the image files(chess pieces, boards etc). You are free to use the images with DHTML Chess, but for other purposes, you need to contact post [at] dhtmlgoodies.com to obtain/purchase a special license (Price: USD119).


Files in package:

  • js/chess.js - Main javascript file for the widget
  • js/external/* - Mootools JS library
  • js/scrolltable.js - Simple javascript file used to create table with fixed header.
  • images/ - Main image folders for the chess pieces.
  • demo-images/ - Images used in the demos. Board backgrounds etc.
  • game_cache/ - Empty folder used by the php script save json data.
  • pgn/ - Collection of sample pgn files.
  • css/ - chess.css which is the main css file and css files used by the demos.
  • /chess.php - chess.js contacts this file via Ajax requests.
  • /PgnParser.class.php - PHP class used to convert pgn files to JSON format.
  • /DGT-game-parser.class.php - PHP class used to convert data from DGT Boards (Used to relay live games - see below)
  • /chess-board.class.php - PHP class used to display a chess board. (If you don't like to work with Javascript)
  • /ChessConfig.php - PHP configuration variables.

Version 2.0 - May 2011

The major changes in version 2.0 are:

  • Cleaner pgn parser
  • Using Mootools instead of SACK for Ajax Requests
  • Callbacks has been replaced with cleaner event handling while preserving backward compability
  • Cleaner configuration
  • Smoother animations
  • Extended support for live relay of games.

Key features

  • Displaying pgn files stored on the server.
  • Drag and drop capabilities which is useful for training.
  • Support for "live" broadcast.
  • Support for different chess sets.
  • Support for 5 different size of chess boards.
  • Pgn to JSON converter. (PHP class)

General info

This script requires php support on the server. chess.js contacts a php script which again contacts a PHP pgn to json converter.

This php class converts portable game notation files(.pgn) to json(Javascript Object notation) which is sent back to the script.

This is illustrated in the figure below:

DHTML Chess Constructor.

The constructor of DHTML Chess supports a config object. The values of this config object determines most of the appearance and behaviour of DHTML Chess

Code example:

var chessObj = new DG.Chess({
  behaviour : {
    animationTime : 0.5,
    examine : 1,
    autoplay : {
      delay : 1,
      delayBeforeComments : 1,
      stopBeforeComments : true
  listeners : {
    'loadgame' : showDetails,
    'newpgn' : showGames
  layout : {
    chessSet : 'alphapale',
    squareSize : 60,
  els : {
    parent : 'board',
    movesInGame : 'divMoves',
    playerNames : 'players',
    currentMove : 'activeMove',
    gameAttributes: {

Config object

The config object sent to the constructor are divided into 4 main categories/objects:

1) layout

layout is an optional object which you can use to configure the appearance of the chess widget. This object supports these paramters:

  • chessSet: Which chess pieces to use. Possible values: alpha,alphapale,smart,cases,leipzig,merida,motif and traveler. You can also change chess pieces at run time by calling the setChessSet method.(Optional)
  • squareSize: Size of squares on the board. Possible values: 30, 45, 60, 75 and 90
  • colorLightSquares: Background color of light squares
  • colorDarkSquares: Background color of dark squares. The color values will not be displayed if background images are specified(see below)
  • bgImageLightSquares: Path to background image(s) for the light squares. String if only one item, an array in case you want to alternate between different images.
  • bgImageDarkSquares: Path to background image(s) for the dark squares. String if only one item, an array in case you want to alternate between different images.
  • cssPath: Alternative path to folder for the css. Default = 'css/chess.css'
  • imageFolder: Alternative path to folder for the images. Default = 'images/'
  • boardLabels Boolean ( true | false) to display board labels (A-H, 1-8)
  • displayPrefaceComments Boolean (true | false). True to display preface comments(comments before the first move). default = true. (Optional)

2) els

els is an object where you put references to HTML/DOM elements on your web page. Here, you can specify where on the page you want insert the DHTML Chess widget. You can also specify which elements you want to update with text from the chess games loaded from the server.

Supported els attributes:

  • parent: Reference to parent element(id<string> or direct reference) of chess widget. DHTML Chess will insert the board as a child of this element
  • movesInGame: A list of the moves in the game will be inserted inside this element. (Optional)
  • movesInGameTableFormat: Reference to If you want to show the moves in table format. (Optional)
  • playerNames: Where to show name of players(Format: "Name of white vs. Name of black").(Optional
  • currentMove: The last played move will be displayed inside this element(example: 2 .. d6) (Optional)
  • gameAttributes: An object where each key should match an attribute in the pgn file(example: "round" in the code example below should match a "round" attribute in the pgn file.

Code example:

  els : {
    parent : 'board',
    movesInGame : 'divMoves',
    playerNames : 'players',
    currentMove : 'activeMove',
    gameAttributes: {

3) behaviour

  • animate: Boolean true or false to activate animations (default = true) (Optional)
  • animationTime: Time used for each animation in seconds (default = 0.5)
  • sound: Boolean (true | false) to enable sound (default = false)
  • flipBoardWhenBlackToStart: Boolean (true | false). When loading game from FEN, initially flip the board when black is first to move. (default = true)
  • flipBoardWhenBlackWins: Boolean (true | false). Initially flip the board when black is the winner. (default = true)
  • highlightLastMove: Boolean (true | false) to highlight the squares of last move.
  • keyboardNavigation: Boolean (true|false). True to enable support for keyboard navigation, false otherwise. When enabled, you can use the arrow keys to walk through the moves of a game. Default value is true
  • autoplay: Object supporting these properties: delay (int - seconds delay between each move), delayBeforeComments (int - override delay with this value when reaching a comment), stopBeforeComments (boolean - stop auto play when reaching a comment)

Code example:

var chessObj = new DG.Chess({
   behaviour : {
     animationTime : 0.5,
     examine : 1

4) Other properties

  • languageCode: This attribute is useful if you want to display the moves(inline or in table) in a specific language. Currently, the script supports "en"(default) and "no"(Norwegian). Example: if this attribute is set to "no", the move Qb3 will be displayed as Dd3.
  • dragAndDropColor: Enables drag and drop for a specific color. Possible values: "white","black" or false. Default = false. (Optional). This can also be controlled by the setDragAndDropColor method. See the tactic demos for help.
  • liveUpdateInterval: This is used when you want to broadcast live games. It specifies the number of seconds between each update request from the client to the server. Default is 0(Off). (Optional)


DHTML Chess supports the following event listeners:

  • beforeloadgame: Fired before a new game is being loaded from the server. Replaces callbackOnBeforeGameLoaded
  • loadgame: Fired after a new game has been loaded from the server. Replaces callbackOnGameLoaded
  • newpgn: Fired after a new pgn file has been loaded from the server. Replaces callbackOnSwitchPgn
  • correctmove: When drag and drop is enabled, this event is fired when a correct move is made (According to the moves specified in the pgn file) Replaces callbackOnCorrectMove
  • wrongemove: When drag and drop is enabled, this event is fired when a wrong move is made. Replaces callbackOnWrongMove
  • aftermove: Fired after a move has been made on the board
  • afterlastmove: Fired after the last move in the game has been made (Replaces callbackAfterLastMove)
  • startautoplay: Fired when autplay is started. Replaces callbackOnStartAutoPlay
  • stopautoplay: Fired when autplay is stopped. Replaces callbackOnStopAutoPlay
  • liveupdate: In live relay mode, this event is fired when new data has been loaded from the server. It can be used to display data such as remaining time on the clock, comp evals etc. Replaces callbackAfterLiveUpdate

When you create your DHTML Chess Javascript object, event listeners are placed inside a "listener" object. Example

var chessObj = new DG.Chess({
   listeners : {
     'loadgame' : showDetails,
     'liveupdate' : receiveLiveUpdate

   layout : {

} );

In version 2 of DHTML Chess, event listeners replaces the old callbacks

Public methods

This is an overview of the public methods:

  • showGame(gameIndex) - Show a game from selected pgn file(0 = first game)
  • showRandomGame() - Displays a random game from selected pgn file
  • setDragAndDropColor(color) - Specify drag and drop color. Possible values: "white","black" or false.
  • setPgn(pgnFile) - Specify path to new pgn file.
  • setSquareSize(squareSize) - Resize board - possible values: 30,45,60,75 and 90.
  • setChessSet(chessSet) -Specify chess set. Possible values: alpha,alphapale,smart,cases,leipzig,merida,motif and traveler.
  • flip() - Flips the board.
  • getNextMove() - Return notation of next move to be played.
  • getResult() - Return result of game.
  • getPgnFile() - Return path to currently used pgn file.
  • getStartColor() - Return starting color, black or white.
  • setFlipBoardWhenBlackToStart() - If true, the board will be flipped automatically when a game is displayed where black starts to move(i.e. position setup).
  • getCurrentGameIndex() - Return index of currently displayed game, i.e. index in pgn file(0 = first game).
  • displayGameListInSelect(selectBox) - Displays list of games in pgn file inside a select box. The argument selectBox is a reference(id, name or direct reference) to a select box on your page.
  • displayGameListInTable(tableReference) - Displays list of games in a HTML table. It's important that this table got a THEAD and TBODY element.
  • moveToStart() - Move to the start of currently displayed game.
  • moveToEnd() - Move to the end of currently displayed game.
  • move(numberOfMoves) - Move forward "numberOfMoves".
  • autoPlay() - Start autoplay mode.
  • stopAutoPlay() - Exit autoplay mode.
  • goToMove(moveNumber,color() - Go to a specific move, example 2, "black".

After you have created your chess object(example by using the example in the "live games" section below), you can call methods like this:

<a href="#" onclick="chessObj.flip();return false">Flip board</a>
<a href="#" onclick="chessObj.moveToStart();return false">To start</a>
<a href="#" onclick="chessObj.moveToEnd();return false">To End;</a>

Broadcast live games

There are two ways to relay live games from DHTML Chess, one by using a mySql database, and one without a database. If you have access to a mySql database, I strongly recommend that you go for this option as it's much easier to maintain. Below, you will find a step by step instruction to both. This scripts supports relaying of game data from remote servers, both in pgn format and in the format used by the DGT Flash chess viewer.

Live broadcast using a mySql database

Step 1: Ask for permission

If you want to relay games from a remote site, you should ask the tournament owner for:

  • Permission to relay game from their site.
  • Which URL they have for their games.

Step 2: Configure database variables

Open ChessConfig.php in a text editor:

define("PGN_FOLDER", "pgn/");
define("CHESS_USERNAME", "chess");
define("CHESS_PASSWORD", "chess");
define("RECEIVE_LIVE_UPDATE_VALID_REFERER", "http://localhost/dhtmlgoodies/scripts/dhtml-chess/receive-live-update.php");

define("CHESS_USE_DATABASE", 1);
define("CHESS_DB_HOST", 'localhost');
define("CHESS_DB_USERNAME", 'db_username');
define("CHESS_DB_PASSWORD", 'db_password');
define("CHESS_DB_NAME", 'db_name');

Specify your own secret username and password in the field CHESS_USERNAME and CHESS_PASSWORD

Set RECEIVE_LIVE_UPDATE_VALID_REFERER to the address of receive-live-update.php on your web site. This file is in the root folder of DHTML Chess.

set CHESS_USE_DATABASE to 1 and insert your db connection values for the other attributes.

Step 3: Open configure-db.php

Open configure-db.php in your browser and append your username and password to the url, example:


This page will create the default database setup.

Step 4: Open receive-live-update.php

Open receive-live-updates.php in your browser and append username and password to the url, example


You should then see a page like this:

This is the page where you administrate relayed events. First, you will see some forms for events in progress. Below, you will find forms where you can add new events.

This is what you put into the form

  • Event name: A unique name of your choice for the event to relay, example "tata-steel-chess"
  • URL to relay: This is the place for the web address of the games to relay. Usually, it's the address you'll see in the address bar when you open tournament site's "live games" page.
  • Hour offset: A value in this field is only needed when the game relay starts late at night and end the next morning(Because of big difference in timezone). Example: If your site has timezone GMT+1 and the tournament site GMT+5, you will put in the value 4 in this field( 5-1)
  • Name of local file: This will be generated automatically from the event name. The name will be "event name + date of the relayed round", example: "tata-steel-chess-2012-01-20" for a round played the 20th of january 2012.
  • Tournament start: In this field, you should type the date when the tournament starts. The date is in the format Year-Month-Day Hour:Minute:Seconds, example: 2023-09-23 01:09:09
  • Tournament end: In this field, you should type the date when the tournament ends.
  • Refresh interval: This is the number of seconds between each load of new game data from the tournament server. I will recommend a value of 60 or higher.
  • Last build: Here, you will see when game data last time was loaded from the tournament server.

To update existing events, modify these values for the "Active relay" boxes. To create a new event, fill in the form of a "New relay" box.

You can test your configuration by clicking the "Test" button. When ready, click the "Save events" button to save.

Step 5: Configure the chess board

Open one of the demo files(example demo-php-write-chess-board.php) in a text editor/IDE. What you need to do is to set pgnFile to the name of the event, example: "tata-steel-chess". You should also specify how often your visitors should poll your server for new game updates.

Example code (demo-php-write-chess-board.php):

   'liveupdateinterval' => 30 // 30 seconds

By completing these steps, your visitors should now be able to see live games on your web site.

Live broadcast without a mySql database

Step 1: Ask for permission

If you want to relay games from a remote site, you should ask the tournament owner for:

  • Permission to relay game from their site.
  • Which URL they have for their games.

Step 2: Configure the chess board

Use one of the demo files as a starting point for your chess board(example: pgn-viewer.html or demo-php-write-chess-board.php). Rename the file to a more convenient file name (example index.html)

Then, open the file in a text editor.

We need to set a value for two Javascript properties. The property liveUpdateInterval has to be bigger than 0(zero). 15 or 30 is usually a good choice. This is the number of seconds between each request for game updates from your visitors browser to your server.

You should also specify path to a local pgn file. Which file name to use is completely your choice. Write down the name, you will need it later on.

var chessObj = new DHTMLGoodies.Chess({
  liveUpdateInterval:15,  /* Update every 15 seconds, i.e. live games */
} );

Step 3: Configure DHTML Chess for automatic game updates

Open /ChessConfig.php in a text editor and make changes to the following properties:

define("CHESS_USERNAME", "<your_username>");
define("CHESS_PASSWORD", "<your_password>");
define("RECEIVE_LIVE_UPDATE_VALID_REFERER", "<http path to your receive-live-update.php file >");

Type in your own secret username and password, and set RECEIVE_LIVE_UPDATE_VALID_REFERER to the URL of receive-live-update.php on your web site(it's located inside the root folder of DHTML Chess).


define("CHESS_USERNAME", "JohnDoe");
define("CHESS_PASSWORD", "SecretPass123");
define("RECEIVE_LIVE_UPDATE_VALID_REFERER", "http://www.dhtmlgoodies.com/scripts/dhtml-chess/receive-live-update.php");

Remember to save the file.

Step 3: Schedule Automatic updates

Open receive-live-updates.php in your browser and append username and password to the url, example


You should then see a screen like this (Click on it to zoom):

This is a page for you (the admin). From here, game data could be fetched automatically from your server or from a remote tournament server. You can fetch data from up to 10 url's simultaneously. As you can see from the screenshot above, I want to receive game data from two URL's. Both are located on the domain dhtmlgoodies.com.

The first URL is for games in DGT format. Notice that I'm only refering to a folder, not a pgn file. Folders should be used when you want to relay games published in DGT format(The standard Flash widget). If you want to relay a static pgn file, the url should include the name of the pgn file (as in the second URL)

To start to retrieve game data, press the "Start" button..

If the script is successful, you will se a green "v" sign at the right side of the text boxes. This means that DHTML Chess has been able to retrieve data from the specified url's and store them in pgn files on your server.

However, a red warning icon indicates that something went wrong.

If this happens, I will strongly suggest that you open the page again in Firefox, and enables the Firebug Add-on (If not installed, find it by pressing Ctrl+Shift+A and search for Firebug)

With Firebug enabled ("bug" icon in top right corner or bottom right corner of your browser), reload the page and press the "Start" button again. In the console panel of Firebug, you should now see one or more lines in red. Expand it by clicking the "+" icon in front of it. You will then see something like this:

What we are interested in here, is the message. In this example, it says that it cannot find the remote file http://www.dhtmlgoodies.com/scripts/dhtml-chess-wrong/game1.txt.

From the message, We can see that there's something wrong with the URL or the game id's. We can continue debug by copying the url from the message and paste it directly into the address bar of my Web browser.

After a few moments, We will probably figure out that the prefix "-wrong" in the url is the culprit.

When everything is working, you should keep this page open. It will collect new game data from the URL's every 60 seconds.

If you rather like to do all this on the server, you can configure a CRON job(Time based job scheduler). Look inside receive-live-update-controller.php to get an overview of which PHP methods to execute.

The users should now be able to following live games on your web site.

JSON format

The figure below illustrates the JSON string sent to the script by the php class:

The PHP class parses pgn files and converts it into JSON format. JSON is a format which is easily read by most programming languages.

More info on json can be found at http://www.json.org.

JSON Cache

The PHP class converts pgn files to JSON. Since this requires some processing on the server, the script has a built-in cache functionality. It will try to store cached files in the folder specified in the ChessConfig.php file. It's important that PHP have write access to this folder. When the PHP script finds a cached version which is newer than the pgn file, it will send the content of this file back to the client instead of parsing the pgn file.


Question: What do I do when the chess board isn't displayed correctly?

Answer: Make sure that you are using a strict or loose doctype. The doctype should be declared on line 1 of your html file. Examples:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Question: The script doesn't load game data from the server

Answer: This sounds like an Ajax problem. Please read the article in my forum for help.

Question: After upgrading the script, the board labels appears on the board instead of at the left side of the board

Answer: Add this to your css file:

/** To make the board labels appear on the left and bottom side of the board */

This is the code for the board where the squares are 60x60 pixels. You may have to add ChessBoardFrame45 and ChessBoardFrame30 in case you're using different size boards.

Rate this script at Hotscripts.com

If you like my script, please rate it at HotScripts.com

Change log

  • May - June, 2011: Major refactoring of the script.
  • January, 29th, 2008: Added a new chess board(walnut/maple) and implemented the keyboard shortcut Ctrl+Shift+F to flip the board
  • November, 12th, 2007: CSS fix for Safari and a pgn parser bugfix
  • August, 27th, 2007: Added support for keyboard events. The left and right arrow can now be used to walk through the moves of a game. You can set the keyboardSupport attribute to false in case you don't want this feature.
  • August, 15th, 2007: Added support for autoplay mode also when animation has been disabled.


Hello,I use an older version of this script on the website of my chess club. Since Firefox 4.0 the scroll bar in the games list is gone. I tried to use your new script, since in the demos the scroll bar works again. But I can't get the new script to work at all. After unpacking on my website, I can choose the files, but no games are being loaded. There is activity in the game_cache folder, but all files in there are 0 bytes. Any idea, where I should start troubleshooting?ThanksAlex
Alex at 10:05AM, 2011/05/27.
Admin comment

Yes, there was some problems with the scroll table in Firefox 4. I have created a temporary workaround for it in the new zip file, by just removing the feature with the fixed header.

I'm working on a new grid widget which I also will use in DHTML Chess, but it will take some time to finish that work.

Regarding your other problems, do you have an url where I can take a look at it.

I also recommend that you replace all short PHP tags (<?) with <?PHP in chess.php chessConfig.php and PgnParser.class.php
DHTMLGoodies at 10:57AM, 2011/05/27.
Hello,thanks for the quick answer. Here are the URLs:the old script (working, except for the scroll bars): http://www.skvellmar.de/presse/pgnviewer/pgnviewer/chess.htmlthe new script (just unzipped your zip file): http://www.skvellmar.de/presse/pgnviewer/pgn/chess.htmlI also tried all the other demo-html-files. It's always the same, I can't get the pgn content to open. Everytime I click on a pgn an empty file is being created in the game_cache folder.Both scripts run on the same server. PHP never gave me any trouble so far (I am running a gallery, a cms, a wiki and some other stuff on the same server all based on php).Thanks for having a look at it.Alex
Alex at 07:30PM, 2011/05/27.
It seems to be a server side problem. Do you see any errors in the log?The new version of the script uses json_encode to convert The pgn data to Json, the format used for data exchange between the server and the DHTML Chess js script. This makes the php code inside PgnParser.class.php cleaner since I don't have to create the json string manually.For testing purpose, try to use the script without cache enabled, i.e. clear the value of game_cache inside ChessConfig.php
DHTMLGoodies at 10:31PM, 2011/05/27.
Ed Collins
Greetings,When using the demo-chess-4.html template, all of the game header information does not seem to appear for my games that have more than 80 moves. (I can understand how it might be difficult to display moves 81-x, but the game header info should still be displayed.)Just thought I'd let you know.Ed
Ed Collins at 01:50PM, 2011/05/29.
Hello,unfortunately I don't have access to the server error logs. I also tried to use the script without cache. Doesn't work. The problem seems to be the JSON converter. Since some empty files are created in the cache-folder (when cache is enabled) the script itself runs obviously. But parsing the pgn files doesn't work, so the files are empty and I can't open the pgns then. Do you have any other ideas? Or do you have a work around for the old script, so the users can use it with firefox 4?Thanks again!Alex
Alex at 02:02PM, 2011/05/30.
Alex,A workaround for the old script is to replace scroll-table.js with the one you find in the new zip file.Ed, I will look more closely into your problem next week. A solution for now can be to set a higher value than 40 for the config parameterelMovesInTableMaxMovesPerTableexample:elMovesInTableMaxMovesPerTable: 50I will create a permanent, more dynamic solution soon
DHTMLGoodies at 06:16PM, 2011/05/31.
Hello,Could you hint me please. I am trying to do Live Chess Coverage using my chess board, but can't figure out how my PGN from my ftp server will be updated from PGN file tournament FTP server. I was told I need wget or script for updating my PGN. Could you tell me where I can get that wget or script for updating my PGN?Thanks,
Artiom at 04:09AM, 2011/06/05.
Hello,I have downloaded your chess board - wow, it seems cool! But where I can find a help file? I mean where I should put PGN on my host server for live games? and where I should setup a path to PGN for tournament server FTP?Thanks again!
Artiom at 01:30PM, 2011/06/05.
Steve Eddins
I have a diagnosis and solution for the problem reported by Alex.I was having exactly the same symptoms that he reported. PGN files wouldn't load, empty cache files were getting created, disabling the cache didn't help, etc. So I started debugging, writing out info into log files from PHP and displaying alert dialogs from the Javascript. This was tedious, but I eventually discovered that the calls to json_encode() inside PgnParser.class.php were returning empty strings. I then discovered that the json_encode() function inside jsonwrapper/jsonwrapper.php wasn't getting called at all. And so I found out that the PHP version on my hosting provider's system has a json_encode() function built in. Furthermore, that json_encode() function has a different calling signature than the one in jsonwrapper/jsonwrapper.php.So here's the fix. In PgnParser.class.php, delete these lines:require_once("ChessConfig.php");if(!function_exists("json_encode")){ include("jsonwrapper/jsonwrapper.php");}And in the same file, delete the second argument in all the calls to json_encode. For example, change:$retVal = json_encode($ret, true);to:$retVal = json_encode($ret);
Steve Eddins at 05:11PM, 2011/06/06.
Hello Steve,thank you very much! Your fix did not work out-of-the-box, but it helped me find the solution. I just had to delete the second argument in the json_encode as you suggested. But I still need the four lines in the beginning of the script. Probably, because my php-version doesn't come with the json-functions. I also checked the file jsonwrapper_inner.php and the functions json_encode has just one argument in there. Wonder why it is called with two then. Or is $arg an array? Anyways, now it works!And also thanks to Alf, the workaround with the scroll bar on the old script works fine too!
Alex at 12:34PM, 2011/06/07.
Admin comment
Thank you Steve,You are right. The second argument "true" shouldn't be there. I have updated the script by changing all$retVal = json_encode($ret, true);to$retVal = json_encode($ret);inside PgnParser.class.phpThanks again.
DHTMLGoodies at 02:34PM, 2011/06/07.

First of all your script is the script i was looking for a loooong time. Now i worked with it for one week and i have to little questions/problems:
1. With the training: The script tells me my answer was wrong if my move is combinated with a exclamation mark in the pqn (6. ... Bxf3!) . Like this: 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 dxe5 5. dxe5 { worse is } Bg4 6. h3
Bxf3! { anders speelt wit e6+/- } 7. Qxf3 e6 8. c4 Nb4 9. Qe4 N8a6 10. Be3 *

2. The jsonencode is not working well for pgn with a lot of variations like this: 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d4 {Diagram #} Bxd4 {*}(5... Nxd4 6.
Nxe5 O-O (6... Ne6 7. Bxe6 fxe6 8. Nd3 Be7 (8... Bb6 $2 9. e5 Nd5 10. c4 {/\c5.
}) 9. e5 Nd5 10. Qf3) 7. Be3) 6. Nxd4 Nxd4 7. f4 Nc6 (7... d6 $1 8. fxe5 dxe5
9. Bg5 Qe7 (9... O-O 10. Nc3 c6) (9... Qd6 10. Bxf6 (10. Na3 Bg4 11. Qe1 O-O-O)
10... gxf6 11. Na3 Rg8 12. c3 Bg4 13. Qa4+ Bd7 $11) 10. Nc3 Qc5 $2) 8. Bxf7+ *

The details give me this variation: [5... Nxd4 6. Nxe5 O-O 7. e5 Nd5 8. Qf3]

I only want you to know.
You did a great job !!!
Boudewijn at 03:08PM, 2011/06/11.
Admin comment

I will take a look at these problems next week.
DHTMLGoodies at 03:42AM, 2011/06/12.
Steve Colding
Dear Sir, I run the website Chessforchildren.com and would very much like your products on my website. I would like to discuss you placing them on my website of course for a fee. I would love to talk to you about the possibility.
Steve Colding
Steve Colding at 10:42PM, 2011/08/05.
I upload your great script to the bluehost, it doesn't work.
When I click the pgn files listed under the pgn tag, nothing happened -- the game tag and move tag shows nothing.

Then, I enable the game_cache, and find the cache files which are not empty files, so I guess the parser php should work.

I'd grateful if someone can help me solve this problem.
Jianzhao at 04:13PM, 2011/08/24.
the link is

Jianzhao at 04:22PM, 2011/08/24.
gamal hosny
Hi, when using the program on my computet, I clicked pgn, no games are shown, what is the problem
Tank you
gamal hosny at 09:36PM, 2011/08/27.
gamal hosny
Sorry I meant that the pgn files are shown, but when clicking the liank of "Lasker for example an empty link apears
gamal hosny at 10:27PM, 2011/08/27.
wow ,
thanks alot for this fantastic script

NOW i want to display comment associated with each move
aliragab at 01:30PM, 2011/08/31.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in .../configure-db.php on line 21- Created database table chess_live_relay and inserted dummy data...Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in .../configure-db.php on line 52- Created database table chess_live_roundsDB configuration complete!..whether is this a problem of my server or codinghelp methanks
123 at 04:31AM, 2011/10/19.
Admin comment
123,First of all, thank you for trying out DHTML Chess.I think you might have a problem with your database connection details. Please verify that you have entered the correct values in ChessConfig.php
DHTMLGoodies at 10:17AM, 2011/10/19.
do you think should i modify CHMOD of any folder r file?
123 at 03:03PM, 2011/10/21.
Admin comment
No, I don't think that's the problem.Open ChessConfig.php in a text editor and change these values:define("CHESS_DB_HOST", 'localhost');define("CHESS_DB_USERNAME", 'db_username');define("CHESS_DB_PASSWORD", 'db_password');define("CHESS_DB_NAME", 'db_name');localhost is probably correct, but you need to insert username and password to your db and the name of the database where you want to store chess data.
DHTMLGoodies at 04:03PM, 2011/10/21.
dear freind,Everything is Ok. but even in the tactical training page i m getting only 'loading game, please wait'. I tried blindfold trainer it works fine. even in the index (chess.html) page i wont get moves list. i think only thing could any DB connection problem.below is at receive-live-update.php pagenothing has been configured{ Warning: include_once(db-connect.php) [function.include-once]: failed to open stream: No such file or directory in /home/u877014158/public_html/test/live-relay-database.class.php on line 4Warning: include_once() [function.include]: Failed opening 'db-connect.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/u877014158/public_html/test/live-relay-database.class.php on line 4Example of remote path: http://www.dhtmlgoodies.com/scripts/dhtml-chess/pgn/live.pgnExample of local file: live.pgn }lot of thanks for your concern
123 at 01:40PM, 2011/10/26.
Admin comment
123,I would love to be able to blaim someone else, but this seems to be entirely my fault :)db-connect.php was missing from the zip file. I have updated the zip file now. You can either download it and pick up the file from there or create your own db-connect.php and put it in the root folder of dhtml-chess. It looks like this:<?phpif(CHESS_USE_DATABASE && CHESS_DB_HOST && CHESS_DB_USERNAME && CHESS_DB_PASSWORD && CHESS_DB_NAME){ $conn = mysql_connect(CHESS_DB_HOST,CHESS_DB_USERNAME,CHESS_DB_PASSWORD); mysql_select_db(CHESS_DB_NAME,$conn);}?>
DHTMLGoodies at 11:02AM, 2011/10/27.
thanks goodie,you know, now my board is working fine. But the database was never installed. Ok will look onto that later.Keep on getting goodies great like thislot of thanks
123 at 05:02AM, 2011/10/28.
Haven't got as far as generating a stand-alone test case as yet, but I seem to be having a problem where if a board is being displayed flipped (using .flip()) then the pieces don't move on the display unless the game to display is longer than one move. If the board is not flipped, then it is fine.I'll try and produce a stand-alone test case, but can anyone shed any light on this?
Adrian at 02:47PM, 2011/10/31.
Admin comment
Adrian,I have just tried your test case, and I don't experience any problem.This is the pgn I tried it with:[Event "Computer chess game"][Site "ALFMAGNE-PC"][Date "2011.08.15"][Round "?"][White "Alf Magne"][Black "Alf Magne"][Result "*"][BlackElo "2400"][ECO "A02"][Time "17:02:47"][Variation ""][WhiteType "human"][BlackType "human"]1. e4 I will need to see this in action in order to help you further.
DHTMLGoodies at 03:14PM, 2011/11/01.
Hi, thanx for that good chess script. i need those kind of scripts in my web page but i need professional help for installation or so. I want to buy all package. Can you get in touch with me about that ? See you.
Cantek at 10:39AM, 2011/11/09.
Admin comment

If you buy an extended commercial license from


You will get up to 1 year of email support.

But before you do that, make sure that your web server supports

* PHP on the server
* A mySql database in case you want to relay live games.

When this is confirmed, I'm sure I can assist you configuring the DHTML Chess script.

Good luck!! :)
DHTMLGoodies at 02:45PM, 2011/11/09.
Hi,I looked at the options but 1 year e mail support exist in only unlimited dom. unlimited scripts pack and it is so expensive :) What i can do is buying the 3. option, and yes my server supports those. By the way can i see a site who is already using that script !Thank you.
Cantek at 08:13AM, 2011/11/11.
I'm back to the original problem of clicking on a pgn file and no games appearing in the list. Is there a simple resolution to this? Please see example at http://www.chesstournamentservices.com/games/demo-chess-database-9.html.
Chris at 11:54PM, 2011/11/14.
Admin comment
Cantek,You don't have to go for the big license :) A smaller license should be sufficient. if you need further details, please send an email to post[at]dhtmlgoodies.com.Chris,Do you think you can download the latest zip file and try that. There was one file missing(db-connect.php) in the previous release. Also, I couldn't find any pgn files on your server. I could see from the response I got after clicking on the pgn file that DHTML Chess was searching inside the "pgn" folder, but was unable to find the file.
DHTMLGoodies at 09:49AM, 2011/11/15.
I recopied over the latest zip file above which now has the db-connect.php file. I also corrected my issue with the pgn files (was getting ahead of myself!). Still have the same issue though even with those issues resolved. Thanks.
Chris at 06:04PM, 2011/12/07.
chess-blindfold-trainers, and others paid to use on my own website?
Yasar at 04:48PM, 2011/12/18.
Hi, I am a final year student at University of Ulster. For my final year project I have to design a chess club website to incorporate administration tools. As it is a chess website a very simple chess game would be a suitable addition. I think I am using PHP, HTML, MYSQL database,any help on where to find any suitable code or where to begin would be very much appreciated. Thanks
Connor at 07:08PM, 2012/01/04.
Hey I tried testing any demo page from your package and I'm pretty decent with code myself but it seems that nothing ever loads. I downloaded the recent version and I'm not missing any files. To see for yourself check out http://www.mychessbrain.com/tactics/demo-chess-database-2.htmlAs you can see nothing loads aside from the interface.
David at 05:36AM, 2012/01/12.
I should also note that I tested it on running a server on my computer, I tested it on my site in godaddy and the chessbrain site for hosting so i doubt its an a server issue but I don't know. But maybe there is a step I'm missing or something obvious? If I simply download the files and upload it to my server or run it off my computer virtually I always get the same error. Tactics are perpetually in loading stage or pgn viewers never display the pgn and only the boards and tabs work. Pgns never load. None of the demos work for me not even the simple ajax pgn viewer. What should I do and why is it not working for me?
David at 03:14PM, 2012/01/12.
Hello goodie,Thanks for your script. How can I change random game selection to normal sequence in training problems? Thanks
Antra at 07:28AM, 2012/01/14.
Hi,I'm having the same problem as David. I uploaded the whole package to my and tried some of the examples. In all examples the loading takes forever.Is there fix for this problem?- Rafiek
Rafiek at 10:09AM, 2012/01/24.
Thanks, very nice program= to be completed, it need: - ECO field in the grid - A function (find) just to move the indicator in the grid,it's easy to make like somthing in LTpgnviewer, - And a little button to affich an analyse board. I'm sûre you can do all this in 1 hour, please help us. Thanks.
samuel at 10:11AM, 2012/01/29.
Admin comment
Hello Everyone,

I'm currently working on DHTML Chess 3.0 which has been created completely from scratch. It will cover all the features of DHTML Chess 2.0 + much more.

Here are some of the features
* PGN Editor (like you have in standard chess programs)
* Pgn viewer as today.
* Possibility of playing against other people.
* Lecture editor which basically means an advanced PGN editor where you can add actions on moves such as : Find the next correct move or click on all hanging pieces. The plan is that you can play lectures as a movie.
* Multiple boards
* Resizable boards

and much more...

If you have any features you would like to be implemented, please post them here.
DHTMLGoodies at 03:13PM, 2012/02/02.
Thanks goodies,I think, we can have an reference tables for our pgn with using a FEN (and convert every half move to a FEN and affiche the next move in our ECO). And let the <div boardgame> working independly with "reference" or "gamemoves".We have to get a FEN for Every half move!And to call a function of game list with...- parsing moves in a format the slice [n_number of half_move, moves_of_pgn] for one pgn - parsing moves in a format pointer [half_move, mane_eco, position_in_eco],(perfect solution, for mixed and huge database)- or simply comparing the [n_half_moves] of the pgn with the ECO moves (fast solution)
samuel at 09:19AM, 2012/02/05.
HI,How can I copying FEN, it's better to programm a copy of FEN after any click on the <div id="buttons">? because i use ('http://www.shredderchess.com/online/playshredder/opening.php?lang=en?keepThis=true&TB_iframe=true&height=570&width=594';) and ... as an analysing board... Many thanks chess goodies
samuel at 10:12PM, 2012/02/05.
This is one of the best looking chess pgn viewers I have seen. However, I can't get the games to load on my website. I put the dhtml files in my website's root directory. None of the pgn games will load in any of the html files. I need some basic instructions on how to get the DHTML Chess script to work.
Henry at 05:09AM, 2012/02/14.
Could not complete ajax request for pgn/2KTSDEF.PGN
Yasar at 06:09AM, 2012/02/18.
Thank you very much for this great work. How can I run it in my computer? It doesn't load pgn files. How can I set up my computer for standalone usage?
Kenn at 03:50PM, 2012/02/22.
I replaced it into my local XAMPP server, I can open it like http://local/phpmyadmin/dhtml-chess/chess.html I noticed that it can parse pgn into game_cache but pgn not loading on board :(
Kenn at 03:30PM, 2012/02/23.
Admin comment
Kenn and Henry,This is something you can try: Give the chess html extension .php instead of .html, example: change from chess.html to chess.php. The alternative is to configure your Webserver to parse .html files with PHP.I have added a preview of the upcomming DHTML Chess 3: http://www.dhtmlgoodies.com/scripts/dhtml-chess-3/demo/game-viewer.html
DHTMLGoodies at 09:03PM, 2012/02/24.
I dit it at last. I configured my webserver to parse .html files with PHP and I set up MySQL server then I created a database there, that's all. It works now. Many thanks for your guidence. Regards.
Kenn at 04:16PM, 2012/02/25.
By the there is not chess opening trainer in the zip file, where can I find it?
Kenn at 12:38PM, 2012/02/26.
Admin comment
Sorry about that Kenn,A demo of the opening trainer has been added now.
DHTMLGoodies at 07:58PM, 2012/02/28.
Thank you, thank you, thank you... Very instructive web page all over.
Kenn at 10:47AM, 2012/02/29.
Hi there,thank you for this script,this is the script that I have been searching for a long time for my chess site.But I have a problem running this script. I extract the package on my local wamp server www directory like that "C:\wamp\www\dhtmlchess" all the files are in dhtmlchess directory.Then I tried to run and get loading forever never see the positions on the board.I have changed short_open_tag on first secondly I configure html parse problem with "AddType application/x-httpd-php .php .html .htm AddType application/x-httpd-php .php3 .html .htm" in httpd config file. Still the same problem,loading and doesnt show any positions. Am I missing something? Could you help me about that?thnx.
Erman at 09:23AM, 2012/03/06.
Ok now I have fixed the problem,I thought that chess tactic training doesnt need database settings,after I define Database variable it worked.But now I have another problem with Pgnviewer and Demo Chess Database html files.. they don't load pgn files,it only show morphy game at first load...Could u help me about this?thnx.
ERMAN at 11:38AM, 2012/03/06.
I have this in apache error log file :[Tue Mar 06 13:41:18 2012] [error] [client] PHP Notice: Undefined index: annotator in C:\\wamp\\www\\dhtmlgoodies\\PgnParser.class.php on line 432, referer: http://localhost/dhtmlgoodies/pgn-viewer.html
ERMAN at 11:42AM, 2012/03/06.

Try changing line 432 in PgnParser.class.php to this:

'annotator' => isset($this->games[$no]['annotator']) ? htmlentities($this->games[$no]['annotator']) : '',
DHTMLGoodies at 04:41PM, 2012/03/06.
Admin comment
Erman,I think it should be Tactic1.pgn with an uppercase "T"
DHTMLGoodies at 11:53AM, 2012/03/07.
In fact I check pgn directory on local,there isn't any tactic1.pgn in the folder.But pgnviewer is listing it in the PGN Tab.Where does it get the names of the pgns?
ERMAN at 12:25PM, 2012/03/07.
Hi!I am using demo-chess-4.html with my own pgn-file. This file containes the Norwegian letters "Æ Ø Å". Fields with these letters appear blank in the heading of the game information.9
Kenneth at 02:32PM, 2012/03/13.
Admin comment
Hi Kenneth,Try to change line 339 in PgnParser.class.phpfrom:$this->games[$gameIndex][$keyValue['key']] = $keyValue['value'];to$this->games[$gameIndex][$keyValue['key']] = htmlentities($keyValue['value']);btw: I'm also a norwegian, so i should have figured out a solution for this years ago:)
DHTMLGoodies at 10:36PM, 2012/03/13.
Thank you, it works!Thank you for all the scripts! They are great!!!
Kenneth at 11:40AM, 2012/03/14.
First of all, I would like to thank the programmer for this greate chess tool .. it is very useful.
My question is .. when you load a pgn file that contains several games .. is there anyway to start the first game and at the end to start the second game automatically and so on till the end of the games ( end of the pgn file ) ?
Thanks again
kamal at 11:26PM, 2012/03/23.
HiI am planning to use the software for training kids.How do convert the messages into sound format, especially in tactics training "Good Move", "Wrong Move", etc. Thanks
srini at 11:49AM, 2012/05/01.
A great job in the war that engages the pgnparser javascript and php, you are the leader, and much thanks...
joseph at 03:24AM, 2012/05/13.
Thank you very much for the wonderful scripts.In version 3, any plans of provide playing interface?
Sandeep at 11:30AM, 2012/05/30.
Thank you very much for a wonder chess program. Are you planning to provide playing interface in near future?Can it be used for one to one private coaching?
Sandeep at 11:34AM, 2012/05/30.
chess player
Hello, I like the dhtml chess v.3 When would it be available to download?
chess player at 07:41PM, 2012/06/01.
Admin comment
Chess Player,I'm currently working on it. The current version does work, but I will like to add some more features to it before I publish it. I cannot say for sure when it will be released, but it will probably not happen until late this year.Send an email to post[at]dhtmlgoodies.com, and I will keep you posted on the progress.---Alf
DHTMLGoodies at 07:39PM, 2012/06/04.
HelloCan anybody help me in getting the tactical exercises in normal sequence instead of random playthanks in advance
redmc at 12:56PM, 2012/06/17.
Hi,I have a problem - in the tactical training page, I am getting only 'loading game, please wait'...(for example http://pokusnyblog.ic.cz/dhtml-chess/tactic-training-medium-board.html)and console in google chrome display this error"Uncaught SyntaxError: Unexpected token < chess.js:124"all text from the log:"Uncaught SyntaxError: Unexpected token < chess.js:124 Request.onComplete chess.js:124(anonymous function) mootools-core-1.3-full-compat.js:937Events.Class.fireEvent mootools-core-1.3-full-compat.js:1755implement mootools-core-1.3-full-compat.js:213Array.implement.each mootools-core-1.3-full-compat.js:328Events.Class.fireEvent mootools-core-1.3-full-compat.js:1753wrapper.extend.$owner mootools-core-1.3-full-compat.js:1633Request.Request.Class.onSuccess mootools-core-1.3-full-compat.js:5131wrapper.extend.$owner mootools-core-1.3-full-compat.js:1633Request.Request.Class.success mootools-core-1.3-full-compat.js:5127wrapper.extend.$owner mootools-core-1.3-full-compat.js:1633Request.Request.Class.onStateChange mootools-core-1.3-full-compat.js:5107wrapper.extend.$owner mootools-core-1.3-full-compat.js:1633(anonymous function"Thanks you for your help
s.j at 08:09PM, 2012/07/30.
Evgeny Lerner
hello!I want to use your nice script for playing 2 peoples on different computers via InternetSo, I need1 Send move to the server (ajax) What js function can give me move's infor2 Server get move from one player and send it no another player. How can I show the move?Thank you
Evgeny Lerner at 10:00AM, 2012/08/25.
Evgeny Lerner
hello!I want to use your nice script for playing 2 peoples on different computers via InternetSo, I need1 Send move to the server (ajax) What js function can give me move's infor2 Server get move from one player and send it no another player. How can I show the move?Thank you
Evgeny Lerner at 10:04AM, 2012/08/25.
HELLO,Fantastic script!! What if instead to load each pgn file, the games list are dynamically generated from data stored into mysql? In that case how can the parser receive the results of the queries?Michael
michael at 06:23PM, 2012/09/11.
Admin comment
Michael,That's how it's done in the new dhtml-chess which are available in alpha-release at www.dhtml-chess.com. ---Alf
DHTMLGoodies at 08:17PM, 2012/09/12.
It seems there is everything!! I just download it and as soon as possible i will try it on my local server. That's seriously great!! Michael
Michael at 03:28PM, 2012/09/13.
hi,i can't import pgn files in database ?With the last release, when i test the file "game-import.html" of the demo with an existing database (created with installer) and a pgn file sample, there'is nothing except a loop : {"data":{"text":"","percent":0},"success":true}Can you help me ?Pascal.
pascal at 01:09PM, 2012/09/30.
Evgeny Lerner
Hi! I've upload all files but it does't workshttp://fancyfreeclub.com/dhtml-chess/chess.html What may be problem? Please, help
Evgeny Lerner at 03:39PM, 2012/11/03.
Dear MrAt step 4 , I've entered installation key ( from CheckLicense.php file ) and clicked forcing new installation key .But the next button was still disabled . I think your code has occurred some errors.I've used xampp 1.7,windows 7 (64 ) , firefox 16I have some bugs"NetworkError: 404 Not Found - http://......../dhtml-chess/ludojs/images/bg-title-bar-buttons.png"bg-tit...ons.pngThe character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol. ...eturn new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version') http://...../dhtml-chess/installer/installer-controller.php?h9m7u6kv 200 OK 68ms mootoo....4.1.js (line 5719)ParamsHeadersPostResponseHTML<br /><b>Strict Standards</b>: Non-static method ChessInstaller::getLicenseKey() should not be called statically in <b>......\htdocs\dhtml-chess\installer\installer-controller.php</b> on line <b>18</b><br />{"data":{"value":"E054DBB89D692D03A9185FB16EF11229"},"success":true}Kindly recheck and fix some above errors Best regards.
invisibleman at 04:39AM, 2012/11/17.
Admin comment
HiI have fixed the server side problem with the license key. You can download the newest zip file or make the following modification to chess-controller.php:Line 19: Use this code instead:$data['value'] = strtoupper(md5(ChessLicense::getKey()));Regarding the problem with disabled button. Try to tab out(Using "tab" key) of the text field to get the license key validated. I'm working on a permanent fix to this problem.Let me know of any other problems and I will guide and help you the best I can.Alf
DHTMLGoodies at 02:10PM, 2012/11/19.
Dear adminI've just installed your script on localhost , but it also has a problem , can't run engine .I see this file - "error-output.txt" it's content:"'houdini.exe' is not recognized as an internal or external command,operable program or batch file."I wonder why we don't use engine by php code only. Instead , you use another exe programI think , some server don't permit to run exe file their hostYour installation script has some errors( javascript mootools ) inside index.php .Just rename mootools files
invisibleman at 05:46AM, 2012/12/14.
Admin comment

The chess engine part of dhtml chess is still experimental. I will work more on that later.

As for PHP code, I think that may be a problem since there aren't any good PHP chess engines out there, at least not to my knowledge. Chess engines has to be fast, and PHP isn't that suitable for such tasks. Engines written in Java might be an option.

ps! DHTML Chess is now available at github.com(https://github.com/DHTMLGoodies/dhtmlchess).

Best regards,
DHTMLGoodies at 02:00PM, 2012/12/17.
Hello.Sorry for my English. I use a translator.I installed your script, and I have a problem.After the transfer of the site to another hosting service following error:"Fatal error: Class 'PGNParser' not found in / home / webgid / webgid.info / kremenchess / pgn / chess.php on line 21."In the previous hosting such an error was not a viewer worked fine.Asked the support and they told me that the new hosting is completely different from the old, and that they do not know where to find the cause of this error.Can you tell me what could be the cause of this error?Thanks in advance.
sergUkraine at 11:28AM, 2013/01/21.
Admin comment
sergUkraine wrote: #

Sorry for my English. I use a translator.

I installed your script, and I have a problem.

After the transfer of the site to another hosting service following error:

"Fatal error: Class 'PGNParser' not found in / home / webgid / webgid.info / kremenchess / pgn / chess.php on line 21."

In the previous hosting such an error was not a viewer worked fine.

Asked the support and they told me that the new hosting is completely different from the old, and that they do not know where to find the cause of this error.

Can you tell me what could be the cause of this error?

Thanks in advance.


Maybe you're using an older version of the DHTML Chess script where it has short PHP tags in PgnParser.class.php

Open the file in the a text editor, and change
DHTMLGoodies at 01:06PM, 2013/01/21.
Rishabh Dave
Hi Admin,I tried this script. Its working amazing. Awesome work by you man.I need help in setting up the timer. I want that the user will get only 1 minute to make a move. If he could not then he will be disqualified.Please let me know how can I do this. ? Thanks in very advance.Regards,Rishabh Dave
Rishabh Dave at 06:50AM, 2013/02/04.
Admin comment
Rishabh Dave wrote: #
Hi Admin,

I tried this script. Its working amazing. Awesome work by you man.

I need help in setting up the timer. I want that the user will get only 1 minute to make a move.

If he could not then he will be disqualified.

Please let me know how can I do this. ?

Thanks in very advance.

Rishabh Dave


I'm sorry for my late reply.

Tactic puzzles on time is a very good idea.

The dhtml chess script here are about to be replaced by the new one available at
dhtml-chess.com (and https://github.com/DHTMLGoodies/dhtmlchess), so I'm not implementing any new features on this script(except fixing bugs).

I have spent some time looking at the code now. I think you may add a start timer inside
the following functions in chess.js:

__releaseDraggedPiece (around line 3534)


this.__dragAndDropAfterMoveCallback.delay(this.behaviour.animationTime * 1000, this);

A timer should start after this.move(1), example:

if(startTimer !== undefined) startTimer();

A call to startTimer should also be done at the bottom of the __loadFen function (around line 2940).

i.e. same code:

if(startTimer !== undefined) startTimer();

Then you can create your own timer function:

Something like:

var startTime;
var allowedTime = 60;
function startTimer(){
startTime = new Date().getTime();

function countDown(){
var elapsed = Math.floor( (startTime - new Date().getTime()) / 1000);
if(elapsed > allowedTime){
alert('Times up');

DHTMLGoodies at 04:13PM, 2013/02/12.
Romy Quizon
Hi, I have already developed a trial version ofmy chess to play it my friends. Then I found out that you have images materials available for download. I download it and changes my images with your good images material. However my chess program does not use web browser. Instead I developed a software as a client to access the PHP/Mysql Server. It's about 90% complete. It's free software to distribute to anyone who loved to play chesswith real player. Now can you evaluate my works, if you want let me know then we can talk more...TYRomy from the Philippines
Romy Quizon at 08:36AM, 2013/04/04.
Romy Quizon
Hi, I have already developed a trial version ofmy chess to play it my friends. Then I found out that you have images materials available for download. I download it and changes my images with your good images material. However my chess program does not use web browser. Instead I developed a software as a client to access the PHP/Mysql Server. It's about 90% complete. It's free software to distribute to anyone who loved to play chesswith real player. Now can you evaluate my works, if you want let me know then we can talk more...TYRomy from the Philippines
Romy Quizon at 08:36AM, 2013/04/04.
Admin comment
Romy Quizon wrote: #

I have already developed a trial version of
my chess to play it my friends. Then I found out that you have images materials available for download. I download it and changes my images with your good images material. However my chess program does not use web browser. Instead I developed a software as a client to access the PHP/Mysql Server. It's about 90% complete. It's free software to distribute to anyone who loved to play chess
with real player. Now can you evaluate my works, if you want let me know then we can talk more...


Romy from the Philippines

Hi Ronny,

I will love to see your chess software.

Regarding the chess images. Remember that the script is free of charge and the images as well as long as they are part of dhtml chess.

Use of the images for other chess scripts is NOT free :)

This has to do with licensing of some of the images. See more on the licensing section on the top of the page. Price for image use is USD119.

DHTMLGoodies at 10:00AM, 2013/04/04.

Post your comment

Don't have an avatar? Create one at Gravatar.com.

Confirmation code:

I play chess at Chess.com!
Rating: 2049

Go to cbolson.com

About/Contact | A good idea? | Submit a script | Privacy notice
© 2005 - 2023 dhtmlgoodies.com