As an old member of talkchess.com, I've been following the discussion about whether to upgrade the takchess.com forum software.
As part of that discussion, I saw a proposal to migrate to myBB and I did a quick test showing how a pgn4web chessboard bbcode could be easily added to a myBB forum. See here for an example:
http://pgn4web.createmybb3.com/thread-2.html
pgn4web has been designed for ease of integration in any software platform supporting javascript; while phpbb2 does not support an admin interface to create custom bbcodes, I wondered how difficult it would be to add a "pgn" bbcode to a phpbb2 forum. After some quick fiddling (with most time spent finding the install file for phpbb2 v2.023) it turns out to be fairly easy with some manual editing of a couple of files. You can see an example here:
http://freeshell.de/~casaschi/tmp/phpbb ... ic.php?t=2
I personally have no fundamental preference whether to upgrade the talkchess forum software or not. Just wanted to point out that whatever choice is made, you can add pgn4web based chessboard bbcode. In fact, you could have had a pgn4web based chessboard bbcode form more than two years, if anyone bothered to ask... it took me few minuted to adapt the code.
technical notes:
what I did in my test forum is just a feasibility study, it might need some fine tuning; for instance it enables the "pgn" bbcode but it deos not show it on the post editor... some PGN I tested required the "Disable Smilies in this post" tick to be checked (otherwise some character sequence in the PGN game would be interpreted as a smily, breaking the chessboard display)... other minor details might need testing and fine tuning, but it seems to work and it should be possible to fix any issue arising as it has been for many other platforms.
instructions how to setup the "pgn" bbcode, assuming using phpbb2 v2.023 (time required: less than one hour)
1) download the latest pgn4web-x.xx.zip package and unzip the content somewhere on the talkchess.com server; in the following I'll assume that the board.html file of the pgn4web package will be accessible externally as http://www.talkchess.com/pgn4web/board.html
2) patch the phpbb2 file includes/bbcode.php adding the following pieces of code in the obvious places (following a list of similar pieces of code for other bbcodes)
Code: Select all
// [pgn] and [/pgn] for chess games.
$text = str_replace("[pgn:$uid]", $bbcode_tpl['pgn_open'], $text);
$text = str_replace("[/pgn:$uid]", $bbcode_tpl['pgn_close'], $text);
Code: Select all
// [pgn] and [/pgn] for chess games.
$text = preg_replace("#\[pgn\](.*?)\[/pgn\]#si", "[pgn:$uid]\\1[/pgn:$uid]", $text);
Code: Select all
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
Code: Select all
bbtags = new Array('[b]','[/b]','[i]','[/i]',[pgn],[/pgn],'[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
Code: Select all
<!-- BEGIN pgn_open --><script type="text/javascript"> var pgn4webPath = "/pgn4web/"; var pgn4webTextareaIdNum; if (pgn4webTextareaIdNum === undefined) { pgn4webTextareaIdNum = 1; } pgn4webTextareaId = "pgn4web_" + pgn4webTextareaIdNum++; document.write("<textarea id='" + pgn4webTextareaId +"' style='display: none;'>"); </script><!-- END pgn_open -->
<!-- BEGIN pgn_close --></textarea> <script type='text/javascript'> document.getElementById(pgn4webTextareaId).value = document.getElementById(pgn4webTextareaId).value.replace(/<\s*br\s*\/>/gi, ' '); height = 268; multiGamesRegexp = /\s*\[\s*\w+\s*"[^"]*"\s*\]\s*[^\s\[\]]+[\s\S]*\[\s*\w+\s*"[^"]*"\s*\]\s*/m; if (multiGamesRegexp.test(document.getElementById(pgn4webTextareaId).value)) { height += 34; } document.write("<iframe src='" + pgn4webPath + "/board.html?am=l&d=3000&ss=26&ps=d&pf=d&lcs=WdSO&dcs=LHCg&bbcs=LHCg&hm=b&hcs=lF6v&bd=c&cbcs=UJuI&ctcs=BoVy&hd=j&md=f&tm=13&fhcs=$$$$&fhs=14&fmcs=$$$$&fccs=v71$&hmcs=M___&fms=14&fcs=m&cd=i&bcs=WdSO&fp=13&hl=t&fh=b&fw=p&pi=" + pgn4webTextareaId + "' frameborder=0 width=100% height=" + height + " scrolling='no' marginheight='0' marginwidth='0'>your web browser and/or your host do not support iframes as required to display the chessboard</iframe>"); </script><!-- END pgn_close -->
http://freeshell.de/~casaschi/tmp/phpbb ... ic.php?t=2