Page 19 of 20

Re: How to post chess games

Posted: Thu Apr 28, 2016 3:32 pm
by pgn4web
H.G.Muller wrote:I thought that things like CGI and PHP were absolutely standard in HTTP servers nowadays. It is clear that people who want to broadcast should have access to some server machine. It wouldn't be anymore difficult to upload a PHP or CGI file than to upload a PGN file.
Uploading a file is not the issue. Making sure that the CGI/PHP script executes flawless is a bit more tricky, think about different versions of PHP and different PHP server configuration settings. Probably more to do with my inexperience than with anything else, but I have some php script in the pgn4web package that did have some problem running on different servers than the couple I tested with. Small stuff, but annoying enough to discourage people without much experience and really looking for something that just works.

Re: How to post chess games

Posted: Thu Apr 28, 2016 4:37 pm
by Rebel
I found a different way using FTP.EXE as found in the Windows directory.

http://www.top-5000.nl/pgn4web/live.htm

Still under construction, but it seem to work.

I run:

Code: Select all

ftp -s:script.txt ftp.top-5000.nl
script.txt

Code: Select all

top-5000.nl
password
cd pgn4web
put c:\arena\arena1.pgn
quit
PS, page is currently refreshed every 5 seconds.

Re: How to post chess games

Posted: Sat Apr 30, 2016 5:01 am
by mjlef
Ed,

There is a small typo near the bottom of that page. You have "Odro" instead of "Ordo".

This will be great to follow the games.

Mark

Re: How to post chess games

Posted: Sat Apr 30, 2016 2:29 pm
by Rebel
The only good bug is a dead bug.
-- DD

Re: How to post chess games

Posted: Thu May 05, 2016 10:59 am
by Rebel
pgn4web wrote:Relying on a standard tool like FTP makes the whole thing easier to setup
Indeed.

It was an easy set-up after all.

Most of the time went into the things Arena was supposed to do, but didn't.

[Wish] - could you add EPD support as shown here on top of the board? People then can paste the current position into their favorite engine for analysis.

Re: How to post chess games

Posted: Thu May 05, 2016 11:21 am
by pgn4web
Rebel wrote:could you add EPD support as shown here on top of the board? People then can paste the current position into their favorite engine for analysis.
If you click on square B8 you get a popup where you can copy the FEN string of the current position or the PGN of the game starting from the current position. That is good enough for the cut&paste requirement.

Not too difficult either to add the FEN string in an HTML element:
Add somewhere in your page this HTML:

Code: Select all

<div id="CurrentPositionFEN"></div>
then add this javascript code:

Code: Select all

function customFunctionOnMove() {
  var theObj = document.getElementById("CurrentPositionFEN");
  if (theObj) { theObj.innerHTML = CurrentFEN(); }
}
At every move the HTML element should be automatically updated to the FEN string of the current position.

Typing this without testing, so hopefully not too many typing errors...

Re: How to post chess games

Posted: Thu May 05, 2016 1:20 pm
by H.G.Muller
Rebel wrote:
pgn4web wrote:Relying on a standard tool like FTP makes the whole thing easier to setup
Indeed.

It was an easy set-up after all.
Well, that is not my experience. From a Windows machine ftp often fails to work when I want to upload something to a Linux machine. It seems the newer Linux ftp servers can only work with clients that are in 'passive' mode. And the ftp that comes with Windows does seem to not support that command. So usually ftp just hangs without doing anything, even when I try something as simple as a DIR command.

I prefer solutions that work 'out of the box', without relying on any external software that the user might or might not have, and that might or might not do what you want. Ftp would definitely be on my blacklist.

Re: How to post chess games

Posted: Thu May 05, 2016 4:49 pm
by Rebel
pgn4web wrote:
Rebel wrote:could you add EPD support as shown here on top of the board? People then can paste the current position into their favorite engine for analysis.
If you click on square B8 you get a popup where you can copy the FEN string of the current position or the PGN of the game starting from the current position. That is good enough for the cut&paste requirement.

Not too difficult either to add the FEN string in an HTML element:
Add somewhere in your page this HTML:

Code: Select all

<div id="CurrentPositionFEN"></div>
then add this javascript code:

Code: Select all

function customFunctionOnMove() {
  var theObj = document.getElementById("CurrentPositionFEN");
  if (theObj) { theObj.innerHTML = CurrentFEN(); }
}
At every move the HTML element should be automatically updated to the FEN string of the current position.

Typing this without testing, so hopefully not too many typing errors...
Thank you, works like a charm.

Re: How to post chess games

Posted: Fri May 06, 2016 4:26 am
by hyatt
H.G.Muller wrote:
Rebel wrote:
pgn4web wrote:Relying on a standard tool like FTP makes the whole thing easier to setup
Indeed.

It was an easy set-up after all.
Well, that is not my experience. From a Windows machine ftp often fails to work when I want to upload something to a Linux machine. It seems the newer Linux ftp servers can only work with clients that are in 'passive' mode. And the ftp that comes with Windows does seem to not support that command. So usually ftp just hangs without doing anything, even when I try something as simple as a DIR command.

I prefer solutions that work 'out of the box', without relying on any external software that the user might or might not have, and that might or might not do what you want. Ftp would definitely be on my blacklist.

Linux ftp servers don't have this problem. It is usually a firewall problem. In passive mode, ftp uses the same connection socket to send data and commands. And since the client end originates the connection, he can be behind a firewall, or a router that is using NAT, and all works well. But if you use non-passive mode, the server end has to open a connection to the client machine to actually send the data. And if the client is behind a firewall or a router that is doing NAT, this is impossible and the connection appears to hang. Since NAT uses fake port renumbering to work, it is impossible to open a connection to a client behind such a firewall/router unless you get really clever with port forwarding settings on the firewall/router.

passive mode solves all of this...

Re: How to post chess games

Posted: Thu May 19, 2016 9:06 am
by Rebel
Paolo, maybe you can help me with the last glitch before I make the applet public. If you go to 1 of the 4 live channels then you will notice that often (usually with draws) the script refuses to go to the next game. I have PGN4WEB initialized as follows:

Code: Select all

<script type="text/javascript">
SetPgnUrl("http://rebel13.nl/pgn4web/arena1.pgn");
   SetImagePath ("alpha/36");
   SetImageType("png");
   SetGameSelectorOptions("Select a game...", false, 8, 8, 0, 8, 8, 8, 10); // (head, num, chEvent, chSite, chRound, chWhite, chBlack, chResult, chDate);
   SetCommentsOnSeparateLines(false);
//   SetAutoplayDelay(500); // milliseconds
   SetAutostartAutoplay(true);
   SetAutoplayNextGame(true);
   SetInitialGame("last");
   SetShortcutKeysEnabled(false);
   SetInitialHalfmove("end", true), 
SetLiveBroadcast(0.01, false, false, false, false); 
 </script>
Is there a way to fix it?