Chess Tempo

Username:
Password:
/ Register

User Details

Username:
Blitz Rating:
Standard Rating:
Logout
July 24, 2008, 06:20:17 pm *
Welcome, Guest. Please login or register.
News: SMF - Just Installed!
 
Pages: [1]
Print
Author Topic: how to use the PGN Viewer not working  (Read 490 times)
semmie
Newbie
*
Posts: 8


View Profile
« on: February 18, 2008, 02:52:49 pm »

Hi all,

I am trying to get pgnviewer to work the way explained on the following page:
http://chesstempo.com/pgn-usage.html

However, although the board and controls are visible no pieces and moves are displayed. I just copied all files provided on the above page in a file. Nothing more, nothing less. Am I missing something?
Logged
semmie
Newbie
*
Posts: 8


View Profile
« Reply #1 on: February 19, 2008, 10:27:40 am »

OK 'solved' the problem, but...it seems that it is having problems with other pgn files than the one provided. Still trying to find a solution for it so in case somebody knows why some pgn files do not return the pgnviewer, please let me know
Logged
semmie
Newbie
*
Posts: 8


View Profile
« Reply #2 on: February 19, 2008, 10:53:32 am »

Ok I have found the problems. Hopefully somebody has a solution to it.

Most PGN files are provided with first some key figures such as where the game was played, the players etc. Those figures are followed by a blank line after which the moves are displayed. A particular PGN file looks like this:

[Event "tt Meesterklasse 0708"]
[Site "Nederland"]
[Date "2008.02.09"]
[Round "6.7"]
[White "Span, Paul"]
[Black "Peelen, Piet"]
[Result "1/2-1/2"]
[ECO "D85"]
[WhiteElo "2274"]
[BlackElo "2330"]
[PlyCount "51"]
[EventDate "2007.09.15"]
[WhiteTeam "HMC Calder"]
[BlackTeam "hotels.nl"]
[WhiteTeamCountry "NED"]
[BlackTeamCountry "NED"]

1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. cxd5 Nxd5 6. e4 Nxc3 7. bxc3 c5 8.
Be3 Qa5 9. Qd2 Nc6 10. Rc1 cxd4 11. cxd4 Qxd2+ 12. Kxd2 O-O 13. d5 Rd8 14. Ke1
Nb4 15. Bd2 Na6 16. Bg5 Kf8 17. Bxa6 bxa6 18. Ke2 Bd7 19. Rhd1 Ba4 20. Rd2 Rdc8
21. Rxc8+ Rxc8 22. e5 Bb5+ 23. Kd1 Ba4+ 24. Ke2 Bb5+ 25. Kd1 Ba4+ 26. Ke2
1/2-1/2

The PGN viewer will not allow to have the preceding figures presented on a seperate line, Rather it wants them on a single line. Furthermore, the blank area between the figures and the actual moves is not allowed. This standard PGN format will not return the pgnviewer which is such a shame since it is so beautiful!.Wink

So how can we solve this?
Logged
richard
Administrator
Hero Member
*****
Posts: 589


View Profile
« Reply #3 on: February 19, 2008, 03:38:03 pm »

Hi Semmie,

I have no problem using the PGN you provided (at least it works when I paste it into the textbox on this page: http://chesstempo.com/pgn-viewer.html) .  I suspect you may be attempting to use the PGN directly when you create the PGN viewer. If so then javascript doesn't allow literal newlines in the middle of a string and you will have to either remove them or convert them into \n.  If you have copied the files to the server you should also be able to load the PGN file (with its newlines unmodified) from the server instead of using it directly.

If this advice doesn't help, then please post (or provide a link to) the exact .html file you are using to try to create the pgn viewer.

Regards,
Richard.
Logged
semmie
Newbie
*
Posts: 8


View Profile
« Reply #4 on: February 20, 2008, 04:44:51 pm »

Thanks Richards,

I had found out that myself and at the moment I am busy trying to incorporate your viewer in Drupal. Hopefully it will work.
Logged
Pages: [1]
Print
Jump to: