View White Black Last moves Res

chess-board-class.php demo

This is a demo of how you can create a chess board using the chess-board-class.php file.

Code used:

Simple example

<?php include("chess-board.class.php"); $chessBoard = new ChessBoard(); $chessBoard->setPgn('pgn/live-games.pgn'); $chessBoard->write(); ?>

Code - customized board:

<?php include("chess-board.class.php"); $chessBoard = new ChessBoard(); // Set path to pgn file $chessBoard->setPgn('pgn/dgt.pgn'); $chessBoard->setCss(array( 'bgColor' => '#7fb2e5', // bg color container around entire chess widget 'bgColorPlayers' => '#53a6d7', // background color player names 'bgColorMoves' => '#bcd2fe', // background color move box 'bgColorClock' => '#95c1d5' // background color clocks ) ); $chessBoard->setJavascript(array( 'liveupdateinterval' => 15, 'serverFile' = 'test/css.php' )); $chessBoard->write(); ?>