Separate games in a pgn database
Posted: 26 Dec 2010, 12:41
Hello everyone.
I'm trying to make an online database viewer in a mix of javascript and php (something like Chess Tempo, but open source). I want the database viewer to be able to load a .pgn database file and ask you which game do you want to browse (in a plain html select). Once you choose the game to view, it will display it in a board (I probably will use jspgnviewer, which is released under the apache license).
So, as I have the viewer, I just need to load the database and show the user the list of games.
Here I can use your help. I've been reading the pgn standard and I was starting to think how I will get the games from the database when I realised this has already been done many times in open source programs. In particular, xboard can load .pgn databases and shows you the list of games. So there is no point in reinventing the wheel. Can someone point me to the exact code which is responsible from the load of .pgn databases in xboard? I guess it will be in C, but I can then translate it to PHP. It is just that when someone else has thought of every little detail, there is no point for me to rethink it, I may as well copy it
Of course any other implementation would do, there is no need to be xboard implementation, but as I'm asking in xboard forum, well, it is kind of logical to ask for the xboard implementation, isn't it?
Thanks.
I'm trying to make an online database viewer in a mix of javascript and php (something like Chess Tempo, but open source). I want the database viewer to be able to load a .pgn database file and ask you which game do you want to browse (in a plain html select). Once you choose the game to view, it will display it in a board (I probably will use jspgnviewer, which is released under the apache license).
So, as I have the viewer, I just need to load the database and show the user the list of games.
Here I can use your help. I've been reading the pgn standard and I was starting to think how I will get the games from the database when I realised this has already been done many times in open source programs. In particular, xboard can load .pgn databases and shows you the list of games. So there is no point in reinventing the wheel. Can someone point me to the exact code which is responsible from the load of .pgn databases in xboard? I guess it will be in C, but I can then translate it to PHP. It is just that when someone else has thought of every little detail, there is no point for me to rethink it, I may as well copy it
Of course any other implementation would do, there is no need to be xboard implementation, but as I'm asking in xboard forum, well, it is kind of logical to ask for the xboard implementation, isn't it?
Thanks.