Advertisement:

Author Topic: Chess Game Viewer Custom Bbcode  (Read 1473 times)

Offline satrancokulu

  • Semi-Newbie
  • *
  • Posts: 11
Chess Game Viewer Custom Bbcode
« on: March 03, 2008, 03:08:04 AM »
Hi i want to replace a bbcode for a chess game viewer. Members familiar with chess may know pgn form for replaying chess games. The code below was for fireboard and you get such a result : http://satranchaberleri.com/satranc-forumu/6.html#67 [nofollow] I wish i could have such a bbcode for SMF too. Can someone advice something if creating a bbcode isnt that hard? I think such a thing will be very good for many chess site forums. You also have to upload ltpgnboard pgn viewer to make it work ofcourse



// 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);

« Last Edit: March 03, 2008, 03:16:11 AM by satrancokulu »