Re: prototype for new go diagram format
Posted: Thu Nov 24, 2016 4:04 pm
Yeah. To give some background, the way godiscussions.com did this was a little different, and it was somewhat of a blocker for getting L19 running. According to the owner of godiscussions.com, the capacity they had was being overrun on the server due to amount of images that were stored on the server, and it caused response time to be very slow. I have no idea if this is actually the reason for the slowness or not, but in order to make a comparable site, we needed to get diagrams working in phpBB. Jordus let me know about this, and I'm the one that set this part of L19 up initially.hyperpape wrote:Cool, I had no idea they required JS.Kirby wrote:Probably will revert to the old diagrams for unsupported scenarios. The existing diagrams require Javascript already, by the way.
I don't know how they did it on godiscussions.com, but basically, instead of storing an image on the server with a particular filename or something and retrieving it for display, the method I used was to generate the image on the fly by passing the diagram code through the URL. So you can technically create diagram images by making your own URL and passing it as a variable.
The contents of what phpBB sees from a post has different data than what the script expects. For example, when you post, you have "br" line breaks which should be newline characters, etc., and these need to be in html format to pass through the URL. I use javascript to convert the text from the post into this format so that it can be sent through the URL to generate an image.
Anyway, the current stuff I'm messing with basically increases the javascript content that occurs and decreases the use of php. In fact, I'm still using the php script to generate the SGF that you can download when you click on the diagram. Since I'm concerned mainly with adjusting the way the diagram looks, I don't see a reason to do away with the part that generates the SGF itself.
