I received many questions on how to add the chess game viewing feature to the
Fireboard forum component for
Joomla!Joomla!.
Here are some instructions:
0) The code below is provided AS IS and WITHOUT ANY WARRANTY. In particular, don't blame me if your server blows up or your chess rating drops after you install this! Make sure you make backups
before making any changes!
1) Download the
LTPGNVIEWER and install it on your webspace. Simply copy the files in a directory. At my site it is under /pgnviewer . Remember where you put it.
2) Look for the file smile.class.php in your Fireboard installation. It can be found in components/com_fireboard/templates/default, although the location might vary depending on your settings.
3) Look for the following code in smile.class.php:
| Code: |
// italic
$fb_message_txt = preg_replace("/(\[i\])(.*?)(\[\/i\])/si","<em>\\2</em>",$fb_message_txt);
|
4) Add the following code to the smile.class.php file, right under the code from point 3:
| Code: |
// chess board
$fb_message_txt = preg_replace("/(\[board\])(.*?)(\[\/board\])/si","<iframe style=\"float:right;\"width=\"300\" height=\"380\" scrolling=\"no\" src=\"/pgnviewer/ltpgnboard.html?SetPgnMoveText=\\2\" > </iframe>",$fb_message_txt);
$fb_message_txt = preg_replace("/\[board move=([0-9])\](.*?)\[\/board\]/si","<iframe style=\"float:right;\"width=\"300\" height=\"380\" scrolling=\"no\" src=\"/pgnviewer/ltpgnboard.html?SetPgnMoveText=\\2&MoveForward=\\1\" > </iframe>",$fb_message_txt);
$fb_message_txt = preg_replace("/\[board move=([0-9][0-9])\](.*?)\[\/board\]/si","<iframe style=\"float:right;\"width=\"300\" height=\"380\" scrolling=\"no\" src=\"/pgnviewer/ltpgnboard.html?SetPgnMoveText=\\2&MoveForward=\\1\" > </iframe>",$fb_message_txt);
|
Make sure, that the path to the ltpgnboard.html corresponds to the one where you installed the LTPGNVIEWER software (in my case /pgnviewer)!
That's it! Now you should be able to include interactive chess boards in your forum posts.
Please post questions/problems in this thread so that other webmasters can learn from it!
Post edited by: Sciurus, at: 2007/09/16 11:29