BBCode phpBB for maxiGos
BBCode version: v3, with maxiGos v8.
Description
With these BBCodes, you can display game of go sgf content using maxiGos sgf player in a post on a forum powered by phpBB.
The procedure below was tested using phpBB 3.0.12, english version.
Installation
- Dowload the maxiGos viewers that have the "forum" theme of maxiGos (see the download page)
- Upload them in a folder (for instance named "scripts/_maxigos") in your phpBB website
- Connect to the administration interface of your phpBB
- Click on "Posting" tab
BBCode using a URL as sgf source
Settings
You need to use in the "HTML replacement" a regular expression that matches the URL. For instance, if the URL is something like http://nomDeDomaineDuForum.org/download/file.php?id=nnn (where nnn is a number), you can use "^http://forumDomainName\.org/download/file\.php\?id=[0-9]+$".
- Click on "Add a new BBCode" button
- Add the following BBCode (one assumes that maxiGos viewer scripts are in a folder named "scripts/_maxigos",
but it can be anywhere, and one assumes that the BBCode name is "gos" but it can be anything else:
just adapt the code below in such a case)
- "BBCode usage:" [gos]{URL}[/gos]
- "HTML replacement:" <script data-maxigos-l="en" data-maxigos-source-filter="^http://forumDomainName\.org/download/file\.php\?id=[0-9]+$" src="scripts/_maxigos/maxigos-forum-basic.js">{URL}</script>
- "Help line:"
Display a sgf player - "BBCode usage:" [gos={IDENTIFIER}]{URL}[/gos]
- "HTML replacement:" <script data-maxigos-l="en" data-maxigos-source-filter="^http://forumDomainName\.org/download/file\.php\?id=[0-9]+$" src="scripts/_maxigos/maxigos-forum-{IDENTIFIER}.js">{URL}</script>
- "Help line:"
Display a sgf player
- Click on "Submit" button
- If you didn't already defined sgf as allowed extention for attachments, click on "manage Extention group" and create a new group, for instance named "Go files", then click on "manage Extention", then add the "sgf" extention (extention group: "Go files").
Then in theory the BBCode is ready to work.
Usage
Insert in your messages a line as below:
Basic player
[gos]http://forumDomainName.org/download/file.php?id=1[/gos]
or
[gos=basic]http://forumDomainName.org/download/file.php?id=1[/gos]
Player with comments
[gos=comment]http://forumDomainName.org/download/file.php?id=1[/gos]
Player displaying diagram
[gos=diagram]http://forumDomainName.org/download/file.php?id=1[/gos]
Player displaying game
[gos=game]http://forumDomainName.org/download/file.php?id=1[/gos]
Player displaying problem
[gos=problem]http://forumDomainName.org/download/file.php?id=1[/gos]
Player with comments and moves tree
[gos=tree]http://forumDomainName.org/download/file.php?id=1[/gos]
Don't forget to remove any parameter such as "mode=view" if any from the URL. Or adapt the regular expression that verifies the URL if you let them. For instance:
data-maxigos-source-filter="^http://nomDeDomaineDuForum\.org/download/file\.php\?(mode=view&(amp;)?)?id=[0-9]+(&(amp;)?mode=view)?$"
BBCode using a TEXT as sgf source
Settings
- Click on "Add a new BBCode" button
- Add the following BBCode (one assumes that maxiGos viewer scripts are in a folder named "scripts/_maxigos",
but it can be anywhere, and one assumes that the BBCode name is "gos" but it can be anything else:
just adapt the code below in such a case)
- "BBCode usage:" [gos2]{TEXT}[/gos2]
- "HTML replacement:" <script data-maxigos-l="en" data-maxigos-html-parenthesis="1" src="scripts/_maxigos/maxigos-forum-basic.js">{TEXT}</script>
- "Help line:"
Display a sgf player - "BBCode usage:" [gos2={IDENTIFIER}]{TEXT}[/gos2]
- "HTML replacement:" <script data-maxigos-l="en" data-maxigos-html-parenthesis="1" src="scripts/_maxigos/maxigos-forum-{IDENTIFIER}.js">{TEXT}</script>
- "Help line:"
Display a sgf player
- Click on "Submit" button
Then in theory the BBCode is ready to work.
Usage
Insert in your messages a line as below:
Basic player
[gos2](;GM[1]FF[4]CA[UTF-8]SZ[19]PW[A]PB[B]WR[6d]BR[6d];B[qd];W[dp])[/gos2]
or
[gos2=basic](;GM[1]FF[4]CA[UTF-8]SZ[19]PW[A]PB[B]WR[6d]BR[6d];B[qd];W[dp])[/gos2]
Player with comments
[gos2=comment](;GM[1]FF[4]CA[UTF-8]SZ[19]PW[A]PB[B]WR[6d]BR[6d];B[qd];W[dp])[/gos2]
Player displaying a diagram
[gos2=diagram](;GM[1]FF[4]CA[UTF-8]SZ[19]PW[A]PB[B]WR[6d]BR[6d];B[qd];W[dp])[/gos2]
Player displaying a game
[gos2=game](;GM[1]FF[4]CA[UTF-8]SZ[19]PW[A]PB[B]WR[6d]BR[6d];B[qd];W[dp])[/gos2]
Player displaying a problem
[gos2=problem](;GM[1]FF[4]CA[UTF-8]SZ[19]PW[A]PB[B]WR[6d]BR[6d];B[qd];W[dp])[/gos2]
Player with comments and moves tree
[gos2=tree](;GM[1]FF[4]CA[UTF-8]SZ[19]PW[A]PB[B]WR[6d]BR[6d];B[qd];W[dp])[/gos2]
To insert a sgf record comming from a sgf file, you can just copy/paste the content of the file between [gos2] and [/gos2] using the phpBB editor. But this editor changes the content such as adding a <br> tag when a line break is encountered in the sgf file, replacing "(" and ")" by their html codes, etc. MaxiGos tries to deal that, but some other adaptations may be necessary according to the situation.
Notes
It is possible to use other variations of the player: just download the convenient player from the maxiGos download page, upload it in "scripts/_maxigos" folder of phpBB, and adapt the BBCode settings.