for the plugin located at
www.proboards.com/library/plugins/item/564This code has TWO parts. the first is a FEN editor you can use to create in post boards to discuss strategy with other members. the second allows you to actually play a game of chess against someone.
FEN editor:
the code will convert any [ChessTag][/ChessTag] tags it finds with FEN string inside in any board, but you can choose only certain boards to make the editor appear. it shows as a new tab down by visual/BBC tabs. It will bring up a blank board you can drag pieces to. I spent a lot of time getting the piececounts to work, so it wont let you place 2 kings or more then 8 pawns or more then 16 pieces of the same color. you can remove a piece from the board by dragging it to the trash. once you place a board, you can get the FEN string, and go back to the editor and paste it in between the chesstag tags.
if you place more then one FEN string between chesstag tags, it will create prev/next buttons below the board on display so that you can switch to the next view. basically you could throw in FEN strings for an entire game, and click through each move.
you can also optionally choose multiple sizes of the board display, as well as different color styles based on some CSS setup by the admin. the code comes with a default style, which can be overidden for all boards, or you can setup multiple alternate styles that can be chosen in the opening tag.
here is how you put a tag into a post:
[ChessTag]{rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R}[/ChessTag]
you can put multiple plays into a tag:
[ChessTag]{rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR}{rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR
}{rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR}{rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R}[/ChessTag]
OR
if you want to paste in a linefeed separated list of EPD strings, the code can read in those as well.
and it will put a prev/next button area below the board that will let you show each move.
you can change the size of the board, by putting an option in the opening tag:
[ChessTag:size=3]
from 0 to 8 omitting the option defaults to size=4
the pieces themselves are options to replace with whatever images you want. but I suggest .png images so they sit on the board. they will resize to fit smaller board squares if they have to.
now about color....
there is a code default already included, but it can be overrided by placing some CSS into the forum CSS:
.chessdiv.default table {border:2px #00FF00 solid}
.chessdiv.default table td {background-color:#EEEEEE;}
.chessdiv.default table td.alternate {background-color:#444444;}
.chessdiv.default table td.labelCell {background-color:#888888; color:#FFFFFF; font-size:10px}
you can also setup custom board colors:
.chessdiv.style_1 table {border:2px #FF0000 solid}
.chessdiv.style_1 table td.boardCell {background-color:#DDDDDD;}
.chessdiv.style_1 table td.boardCell.alternate {background-color:#FFBBBB;}
.chessdiv.style_1 table td.labelCell {background-color:#888888; color:#FFFFFF; font-size:10px}
and when you make a post, put in
[ChessTag:style=1]
and it will use those colors instead. it doesnt have to be a number either, you could make it
.chessdiv.style_wormo table {border:2px #FF0000 solid}
.chessdiv.style_wormo table td.boardCell {background-color:#DDDDDD;}
.chessdiv.style_wormo table td.boardCell.alternate {background-color:#FFBBBB;}
.chessdiv.style_wormo table td.labelCell {background-color:#888888; color:#FFFFFF; font-size:10px}
and any board with the option style=wormo in the opening tag would get that applied
you can combine the options like:
[ChessTag:size=6,style=1]
if someone tries to call a style that doesnt exist, it goes back to the colors setup in the code itself.
Playing a Game:
The second feature of this plugin, allows two players to play a game. a new button "Play Game" should appear next to create thread in whichever boards you designated the plugin to run in. click that button, and it will ask who you want to play against. when you select someone, it will start a new thread and bring up a new board. white moves first, and the challenger plays white. once you make the opening move, select "I moved" from below the board, and it saves it to the thread for display. when looking at any thread with a running game, the first post will display the current board positions, but you can hit the prev/next buttons below it to see how the game progressed. when its a player's turn, it will show a "Its your move" button above the board, that when clicked will bring up the playable board again.
on the playable board, each of your pieces when hoverd will show in green the squares you can legally move to. it checks for king danger by eliminating moves that would put it into check. it highlight any opponent piece that can be captured in red. it will also highlight in yellow any special moves like en passant and castling. when king is in check, it will show in red on display and playable board along with an alert message. if king is in mate, the game is over and no further plays can be made.
since its a thread, regular replied can still be added to the thread without affecting the game itself. it will also tag both players in the first post for searching or notification. there isnt currently any notification when its someone's turn, but Im looking into it.
enjoy